[fix] call init
Signed-off-by: Anton Nesterov <anton@demiurg.io>
This commit is contained in:
parent
80410d5585
commit
59b2dde114
|
@ -63,6 +63,7 @@ Serve starts the basic server on the configured port.
|
||||||
Use `GetHandler` to get a handler for a custom server.
|
Use `GetHandler` to get a handler for a custom server.
|
||||||
*/
|
*/
|
||||||
func (s *SQLiteServer) Serve() {
|
func (s *SQLiteServer) Serve() {
|
||||||
|
s.Init()
|
||||||
err := http.ListenAndServe(":"+s.Port, s.GetHandler())
|
err := http.ListenAndServe(":"+s.Port, s.GetHandler())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
|
@ -11,6 +11,11 @@ import (
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
This function validates and escapes the SQL query.
|
||||||
|
|
||||||
|
I copied it from somewhere, but I can't remember where is original source. Tell me if you know.
|
||||||
|
*/
|
||||||
func EscapeSQL(sql string, args ...interface{}) ([]byte, error) {
|
func EscapeSQL(sql string, args ...interface{}) ([]byte, error) {
|
||||||
buf := make([]byte, 0, len(sql))
|
buf := make([]byte, 0, len(sql))
|
||||||
argPos := 0
|
argPos := 0
|
||||||
|
|
Loading…
Reference in a new issue