Go-sqlite3: 2.0.0

Created on 15 Jun 2018  路  13Comments  路  Source: mattn/go-sqlite3

Go-SQLite3 v2.0.0

WORK IN PROGRESS

Please Submit Your Wishes / Requests

Planned Updates

  • [ ] Add Context to errors More Information
  • [x] Add additional tests for provided options
  • [x] Fix Extension loading; current when a module cannot be found it returns an unknown error 115 from SQLite; provided more error information which extension could not be loaded.
  • [x] Implement Golang:1.10 SQL Connector
  • [x] Rewrite connection configuration
  • [x] See if sqlite3.go can be split on a functional level with moving to code for statements to its own file
  • [x] Update Examples
  • [x] Research if in combination with new configuration if the DSN connection can be configured with options without a _ prefix.
  • [x] Add more comments to explain workings to allow easier contribution
  • [x] Add contributing guide
  • [x] Increase code coverage
  • [x] Implement Golang project layout

Tests

Write additional tests

  • [x] Foreign Keys
  • [ ] FTS5
  • [ ] ICU
  • [x] Introspect
  • [ ] JSON1
  • [ ] Secure Delete (If possible)
  • [X] Stat4
  • [x] User Auth
enhancement

Most helpful comment

I would like v2 be compatible with Go modules.

All 13 comments

@mattn Please checkout and take a look, documentation is not done yet. Can you provide some feedback for me ?

Thanks your great works. I'm thinking all of tasks are not required for 2.0.0 .

@mattn Will update the tasks

@mattn I will complete the 2.0.0 and incorporate all the current missing items like documentation.

@mattn I would like to know how do you feel about introducing a dependency on github.com/pkg/errors so we can wrap errors and provide more and better error information.

I don't have strong opinion but what the use-case?

Is there a support for Update Hook? (https://www.sqlite.org/c3ref/update_hook.html)

Is it possible to set a callback to be called whenever I insert, update or delete?

@mattn Use case is to better track down errors; we can add an additional context error where it occurs. So when printing the stacktrace you can better track down where it originated.

@y4dkit Will look into it; I will try so see if I at least can inject the open Pre-Update Hook.
Have you written an example for the update hook maybe ?

I've been using the update hook in the following manner, which has worked reasonably well in the majority of circumstances:

image

The problem is pretty simple though... tables created without rowid pose a problem, because (obviously) there is no rowid.

Typically, my apps need to use the data in some manner. A common scenario is inserting a record and, then re-querying the DB to retrieve the row that was inserted. It would be nice if there were a reference to the whole row(s) instead of re-querying the DB. Perhaps there's a more elegant way, but I would love to see a map[string]interface{} representing the entire record instead of just the rowid. This would a) not be rowid dependent and b) supports this type of use case.

RegisterUpdateHook is just a wrapper around sqlite3_update_hook. It sounds to me like this is a feature request for SQLite itself, not this library. I suggest posting on the mailing list.

@rittneje ah, I see... it does indeed seem like a feature request for sqlite, not this project.

I would like v2 be compatible with Go modules.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gaorongfu picture gaorongfu  路  10Comments

jacentsao picture jacentsao  路  6Comments

hackertron picture hackertron  路  10Comments

barnettZQG picture barnettZQG  路  7Comments

dylanlyu picture dylanlyu  路  6Comments