Skip to content

Conversation

simolus3
Copy link
Contributor

Currently, :core has build logic ensuring a copy of SQLite is bundled with all apps depending on it. That's usually what we want because the SQLite build from operating systems is either unavailable (Android) or outdated / missing extension support (Apple).

However, it also means that the SQLite library can't be customized. This is an issue for users wanting to use say SQLCipher. As a first step towards that, this:

  1. Introduces the :common (really unfortunate that :core was taken :D) project containg virtually all sources and tests that currently live in :core. The only difference is that this project doesn't depend on sqlite-bundled or the :static-sqlite-driver.
  2. Refactors :core to mostly be an empty shell depending on :common and the bundled SQLite dependencies.
  3. Introduces a test helper so that we can write tests in both SDKs. The test helper allows :common to depend on :core and bundled SQLite in its tests only.

The idea is that users not wanting to depend on the regular SQLite build could customize things by depending on :common instead.

Copy link
Contributor

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an amazing step towards making the SDK more modular. Very happy with these changes from my side.

- `commonJava` - Shared logic for Android and Java targets.
- `androidMain` - Android-specific code for loading the core extension.
- `jvmMain` - Java-specific code for loading the core extension.
- `nativeMain` - A SQLite driver implemented with cinterop calls to sqlite3.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are also some other folders like appleMain and appleNonWatchOsMain in here. Might be worth mentioning.

}
}

cinterops.create("sqlite3") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for my clarification. We aren't linking SQLite in Common, but we're just declaring the interop headers which will be linked later?

* params = params
* )
* ```
* TODO: Internal Team - Status changes are reported on [statusStream].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually not sure what this TODO was for. We should probably remove this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants