diff --git a/_example/vtable/vtable.go b/_example/vtable/vtable.go index 0e60827..8f5a957 100644 --- a/_example/vtable/vtable.go +++ b/_example/vtable/vtable.go @@ -5,6 +5,7 @@ import ( "fmt" "io/ioutil" "net/http" + "strings" "github.com/mattn/go-sqlite3" ) @@ -26,13 +27,14 @@ func (m *githubModule) Create(c *sqlite3.SQLiteConn, args []string) (sqlite3.VTa if len(args) < 3 { return nil, fmt.Errorf("githubModule: unexpected arguments: %v", args) } + tableName := `"` + strings.ReplaceAll(args[2], `"`, `""`) + `"` err := c.DeclareVTab(fmt.Sprintf(` CREATE TABLE %s ( id INT, full_name TEXT, description TEXT, html_url TEXT - )`, args[2])) + )`, tableName)) if err != nil { return nil, err }