Skip to content

database/sql driver

Latest
Compare
Choose a tag to compare
@alicebob alicebob released this 15 Sep 07:15
· 4 commits to master since this release
e4b4152
let's make a database/sql driver (#32)

* driver skeleton

* comments

* basic tablescan

* '*' is a special token

* parse the query and get the tablename from the SELECT

If it's a SELECT, otherwise we'll complain.

* Update driver/driver.go

Co-Authored-By: Sebastien Binet <binet@cern.ch>

* use the current Go version

* add db.Columns() method

* use the main sqlittle to access the tables

It already has all the details about columns and rows, which can get
weird sometimes.

* don't pretend Exec() works

* support column names in SELECT

It doesn't yet error on invalid column names.

* introduce `SelectDone()`, which can stop iterating

* make rows.Close() stop the iterating, no go routine leak

* don't drop the error for invalid column names

"invalid column" errors will only be returned via rows.Err() for now.

* implement QueryContext instead

* test for QueryRow

Nothing we need to do to support that function, but just a test to be
sure it really works.

* no more autoreadme :(

It doesn't support Go modules. Any alternative?

* add driver to the main README

* comment typo

* be more explicit about the implemented interfaces

Co-authored-by: Sebastien Binet <binet@cern.ch>