How to use SQLite in Kotlin / Native?

For a multi-platform project, I consider Kotlin / Native , hoping to have a common code base, at least for business logic and data storage.

To save data, I would like to use a database such as SQLite. However, according to https://stackoverflow.com/a/167159/16/1680520/... , if I want to compile Kotlin / Native, I cannot use any Java file. If I understand this correctly, it also means that any SQLite library that I include cannot import from Java.

When searching for such a library, I found two interesting projects of the Jetbrain database, namely Anko SQLite and Exposed . However, when copying the source code at the time of writing, both import from Java (for example, java.sql). Most likely, I can not use them.

One of my ideas was to use the c-based sqlite library , since according to the mentioned stream , Kotlin / Native code is allowed to use c libraries. It may be possible, but I wondered if there was any way Kotlin suggested using SQLite or another database in Kotlin / Native?

+4
source share
1 answer
+2

Source: https://habr.com/ru/post/1690194/


All Articles