Using SqlDelight in only two source sets / excluding a source set #3949
Replies: 4 comments 3 replies
-
without a reference to any file / class / function from sqldelight code in js , the exported production js bundle shouldn't include any code generated using sqldelight , sqldelight just downloads dependencies , other than that it should be fine ? |
Beta Was this translation helpful? Give feedback.
-
My question is , how can I get sqldelight plugin to ignore the js source set , or only apply it to the android and jvm source set |
Beta Was this translation helpful? Give feedback.
-
sqldelight will generate for all the different targets, you could make a separate module for your sqldelight code and then only add the dependency on that new module to the targets you want |
Beta Was this translation helpful? Give feedback.
-
Copying the sqldelight folder from commonJvmMain to commonMain may solve the issue temporarily, but it is not the right approach. Ideally, you should be able to reference the sqldelight folder in commonJvmMain from commonMain without any problems. One possible reason why the sqldelight folder is not being detected in commonMain could be due to the missing sourceSet declaration in the commonJvmMain block. You can add the following code to the commonJvmMain block to declare the sourceSet: Then, in the commonMain block, you can reference the sqldelight folder as follows: This should allow you to use the sqldelight folder in commonMain without any issues. |
Beta Was this translation helpful? Give feedback.
-
I want to use Indexed db in JS and sqldelight in JVM / android
I don't want to duplicate code for the JVM or android , I also want to use the same functions so expect would go into commonMain and sqldelight module commonJvmMain would implement the actual functions using sqldelight while JS would implement using indexed db
But the problem is the task generateCommonMainInterface doesn't detect the sqldelight folder present in the commonJvmMain module , so I copied the folder to commonMain instead , is this right ?
Beta Was this translation helpful? Give feedback.
All reactions