()
| 27 | } |
| 28 | |
| 29 | func init() { |
| 30 | regex := func(re, s string) (bool, error) { |
| 31 | return regexp.MatchString(re, s) |
| 32 | } |
| 33 | sql.Register("sqlite3-regexp", |
| 34 | &sqlite3.SQLiteDriver{ |
| 35 | ConnectHook: func(conn *sqlite3.SQLiteConn) error { |
| 36 | return conn.RegisterFunc("regexp", regex, true) |
| 37 | }, |
| 38 | }) |
| 39 | csql.Register(Type, csql.Registration{ |
| 40 | Driver: "sqlite3-regexp", |
| 41 | HashType: fmt.Sprintf(`BINARY(%d)`, quad.HashSize), |
| 42 | BytesType: `BLOB`, |
| 43 | HorizonType: `INTEGER`, |
| 44 | TimeType: `DATETIME`, |
| 45 | QueryDialect: QueryDialect, |
| 46 | NoOffsetWithoutLimit: true, |
| 47 | NoForeignKeys: true, |
| 48 | Error: func(err error) error { |
| 49 | return err |
| 50 | }, |
| 51 | Estimated: nil, |
| 52 | RunTx: runTxSqlite, |
| 53 | }) |
| 54 | } |
| 55 | |
| 56 | func runTxSqlite(tx *sql.Tx, nodes []graphlog.NodeUpdate, quads []graphlog.QuadUpdate, opts graph.IgnoreOpts) error { |
| 57 | // update node ref counts and insert nodes |
nothing calls this directly
no test coverage detected