Hey folks! Quick question. Added SQLDelight 2.0.1 ...
# squarelibraries
s
Hey folks! Quick question. Added SQLDelight 2.0.1 to my project and my schema isn't recognizing TIMESTAMP as a field. Same with v2.0.0 as well. Any idea if I should be importing anything extra? Error :
Copy code
<type name real> expected, got 'TIMESTAMP'
P.S - This is the first time I am trying to use SQLDelight
Okay. I had to add the dialect to the
sqldelight
block to fix it.
Copy code
sqldelight {
        databases {
            create("MainDB") {
                packageName.set(namespace)
                dialect("app.cash.sqldelight:postgresql-dialect:2.0.1")
            }
        }
    }
I dont think this was given in the docs. Can we add this to it? 👀
h
Can you please say what do you miss? https://cashapp.github.io/sqldelight shows the overview of the platforms and dialects, and the MySQL page contains the information
s
In the sense, it wasnt mentioned in the android section. Maybe it was an obvious thing that I missed.
Also, the queries dont get generated and the build fails with the following error :
Copy code
Unresolved reference: jdbc
Any idea why this is happening?
h
You want to use mysql with android?
You need to add the jdbc driver as dependency:
app.cash.sqldelight: jdbc-driver:2.0.1
1
s
You want to use mysql with android?
Using postgresql with android my bad. Thanks for this though 🙏