MCPcopy Create free account
hub / github.com/mattn/go-sqlite3 / Create

Method Create

sqlite3_opt_vtable_test.go:35–62  ·  view source on GitHub ↗
(c *SQLiteConn, args []string)

Source from the content-addressed store, hash-verified

33}
34
35func (m testModule) Create(c *SQLiteConn, args []string) (VTab, error) {
36 if len(args) != 6 {
37 m.t.Fatal("six arguments expected")
38 }
39 if args[0] != "test" {
40 m.t.Fatal("module name")
41 }
42 if args[1] != "main" {
43 m.t.Fatal("db name")
44 }
45 if args[2] != "vtab" {
46 m.t.Fatal("table name")
47 }
48 if args[3] != "'1'" {
49 m.t.Fatal("first arg")
50 }
51 if args[4] != "2" {
52 m.t.Fatal("second arg")
53 }
54 if args[5] != "three" {
55 m.t.Fatal("third argsecond arg")
56 }
57 err := c.DeclareVTab("CREATE TABLE x(test TEXT)")
58 if err != nil {
59 return nil, err
60 }
61 return &testVTab{m.intarray}, nil
62}
63
64func (m testModule) Connect(c *SQLiteConn, args []string) (VTab, error) {
65 return m.Create(c, args)

Callers 1

ConnectMethod · 0.95

Calls 1

DeclareVTabMethod · 0.80

Tested by

no test coverage detected