crawshaw / sqlite

Go SQLite3 driver
ISC License
561 stars 67 forks source link

Code generation? #106

Closed delaneyj closed 2 years ago

delaneyj commented 3 years ago

There has been talk of sqlc's code generation supporting crawsahw/sqlite. It made me think since SQLite is such a different database would it make more sense as something handled directly in a tool like sqlitex? My guess is the driver is not aware enough of the contents to generate code but may have more insight than i realize.

AdamSLevy commented 3 years ago

In general this package is a fairly thin wrapper around the actual sqlite C API. It doesn't perform any analysis on queries although it does provide statement caching within a Conn. This speeds up subsequent Prepares. However the caching doesn't know anything about the query, it just uses the query string as the key.

In other words, this library does not parse SQL. Does that answer your question? I don't have the context on sqlc or the discussion you linked.