Native driver doesn't complain when db file doesn't exist, and queries don't return anything
See original GitHub issueRuntime Environment SQLDelight version: 1.4.0 Application OS: MacosX64
Created a Multiplatform project following the instructions here, and have a simple query, both on JVM (JdbcSqliteDriver
) and native (NativeSqliteDriver
) (please see sample project attached).
On the JVM when the .db the file is present, the query works and displays
Hello, World!
Activity_log [
id: 1
type: 0
year: 2018
month: 10
day: 1
hour: 9
minute: 30
]
On MacOS, whether the .db file is here or not, the query doesn’t return anything:
$ ./gradlew build
$ ./build/bin/macosX64/debugExecutable/workinghour2.kexe
Hello, World!
null
Shouldn’t there be an error message when the db file cannot be opened?
Also I was wondering if there’s a way to enable some logs? Right now I find it difficult evaluating where the problem could lie.
Here’s the project in question: sqldelightnativeproblem.zip
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
java h2 in-memory database error: Table not found
This means that your H2 in memory database is not initialized. If you are using Hibernate you can use <property name="hbm2ddl.auto" value="create"/> for...
Read more >(The only proper) PDO tutorial - Treating PHP Delusions
Note that although PDO is the best out of native db drivers, ... The only difference is (as DML queries do not return...
Read more >10 Most Common Mistakes That PHP Developers Make - Toptal
Common Mistake #2: Misunderstanding isset() behavior. Despite its name, isset() not only returns false if an item does not exist, but also returns...
Read more >Opening A New Database Connection - SQLite
A database connection handle is usually returned in *ppDb, even if an error occurs. The only exception is that if SQLite is unable...
Read more >Die! Or How to Cancel Queries in Oracle SQL Developer
Everything you need to know about cancelling queries in Oracle SQL Developer.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@BoD Ok, thanks for your feedback.
Here is the solution to configure it: https://github.com/cashapp/sqldelight/issues/1787
I fiddled a bit around with that and indeed I have in no place I wanted it write/read permissions and would need to ask the user. 😕
I believe there is an option to save in
~/Library/Containers/<yourappname>/
without asking for permission because Sentry does put it’s logs here, but I also ran into issues with that.So I guess I will solve this on another day as I already invested too much time here.
Hi @AshStefanOltmann in the end the default file location was good enough for my use-case. Also on MacOS there may be (not 100% sure) a permission to ask when trying to write files elsewhere.