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.

Native driver doesn't complain when db file doesn't exist, and queries don't return anything

See original GitHub issue

Runtime 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:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
AshStefanOltmanncommented, Feb 16, 2022

@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.

0reactions
BoDcommented, Feb 16, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

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