question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding SQLDelight to the project

See original GitHub issue

I would like to ask a question, if you can help me with it: I’m trying to add SQLDelight to the project. In its doc page it is said to add these dependencies:

kotlin {
  // The drivers needed will change depending on what platforms you target:

  sourceSets.androidMain.dependencies {
    implementation "com.squareup.sqldelight:android-driver:1.4.3"
  }

  // or sourceSets.iosMain, sourceSets.windowsMain, etc.
  sourceSets.nativeMain.dependencies {
    implementation "com.squareup.sqldelight:native-driver:1.4.3"
  }

  sourceSets.jvmMain.dependencies {
    implementation "com.squareup.sqldelight:sqlite-driver:1.4.3"
  }
}

So, in which part of the template should this be added? I have failed to find specific sourceSet for native, to tell the truth.

Thanks

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Alex009commented, Dec 1, 2020

@Jaime97 @rhonyabdullah here you can see how configure sqldelight with moko-template

ccc530b

i use this docs for setup - https://kotlinlang.org/docs/mobile/configure-sqldelight-for-data-storage.html

I see, i’m just checking out to sqldelight branch and found that you create DatabaseDriverFactory class into each ios folder (x64 and arm64)

So, can you confirm that each time we need an ios platform specific the related classes should be created on both x64 and arm64 folder ? Any workaround about how to just put the ios actual class into iosMain only ?

iosArm64Main is symbolic link to iosX64Main. It is workaround because sqldelight not provide iosMain metadata artifact. You will change only sources in iosX64Main - arm will use same code by symlink

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using SQLDelight in Kotlin Multiplatform Project
A comprehensive example of integrating SQLDelight library in a Kotlin Multiplatform project.
Read more >
Getting Started - SQLDelight - Cash App Code Blog
First apply the gradle plugin in your project. ... Put your SQL statements in a .sq file under src/commonMain/sqldelight . Typically the first...
Read more >
Intro to SQLDelight - LogRocket Blog
The only change will be the dependency of the database driver that's added. To begin, open IntelliJ and create a new project inside...
Read more >
SQLDelight: Getting Started - Tony Owen - Medium
Here's what needs to be added to your gradle build files. Project build.grade file: dependencies { // any other shizzle classpath 'com.squareup.sqldelight: ...
Read more >
Adding some Storage (to) Space - John O'Reilly
So, in previous post (Minimal Kotlin Multiplatform project using ... So, changes to add SQLDelight to project were made in following commit.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found