https://kotlinlang.org logo
#squarelibraries
Title
# squarelibraries
j

Joep Eding

09/27/2023, 10:00 AM
Hi! I'm working on a native driver for MySQL. The documentation for SQLDelight says:
To test the driver you can depend on the
driver-test
and extend
DriverTest
and
TransactionTest
to ensure it works as SQLDelight would expect
However, that line is 3 years old, the
DriverTest
-class defines its package as
com.squareup.sqldelight.driver.test
not
app.cash....
, and I can find neither
app.cash.sqldelight:driver-test
nor
com.squareup.sqldelight:driver-test
. Am I doing something wrong or is that piece of documentation incorrect?
d

Derek Ellis

09/28/2023, 11:15 PM
That comment in the docs is definitely out of date/lacking clarity. The
driver-test
module isn't published, and I think it was more meant for internal testing of "first-party" drivers. It predates dialects other than SQLite so it isn't really set up to test those kinds of drivers. I think the module can still serve as a helpful reference to see the kinds of behaviours that you should test on your driver, but you'll have to implement them for your driver separately.
I'll see about updating the docs to clarify how/what to test drivers
and also if your driver is open source, we'd love to feature it in the docs!
j

Joep Eding

09/29/2023, 5:50 AM
Thanks for the clarification Derek!
and I think it was more meant for internal testing of "first-party" drivers.
I started copy-pasting the abstract test classes from the SQLDelight repo and I noticed this. So far, I've got the
DriverTest
s and most of the `QueryTest`s working with only minor changes to get around the SQLite-specific stuff.
and also if your driver is open source, we'd love to feature it in the docs!
It will be, as soon as I've got the whole interface implemented and all tests passing