MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / main

Function main

test/stable/main.go:81–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79}
80
81func main() {
82 log.SetLevel(log.InfoLevel)
83 var config, password, dsn string
84
85 flag.StringVar(&config, "config", "./conf/config.yaml", "config file path")
86 flag.StringVar(&dsn, "dsn", "", "database url")
87 flag.StringVar(&password, "password", "", "master key password for covenantsql")
88 flag.Parse()
89
90 go func() {
91 http.ListenAndServe("0.0.0.0:6061", nil)
92 }()
93
94 err := client.Init(config, []byte(password))
95 if err != nil {
96 log.Fatal(err)
97 }
98
99 db, err := sql.Open("covenantsql", dsn)
100 if err != nil {
101 log.Fatal(err)
102 }
103
104 tableName := fmt.Sprintf(tableNamePattern, 0)
105 _, err = db.Exec(fmt.Sprintf("DROP TABLE IF EXISTS %s;", tableName))
106 if err != nil {
107 log.Fatal(err)
108 }
109
110 createSqliteTestTable(db, tableName)
111
112 pool := grpool.NewPool(8, 16)
113 defer pool.Release()
114 insertData(db, tableName, 500000000, pool)
115 pool.WaitAll()
116
117 err = db.Close()
118 if err != nil {
119 log.Fatal(err)
120 }
121}

Callers

nothing calls this directly

Calls 8

SetLevelFunction · 0.92
InitFunction · 0.92
FatalFunction · 0.92
createSqliteTestTableFunction · 0.85
insertDataFunction · 0.85
ExecMethod · 0.65
CloseMethod · 0.65
OpenMethod · 0.45

Tested by

no test coverage detected