From 59b2dde1145d4adff88634ba98c6918a8870d429 Mon Sep 17 00:00:00 2001 From: Anton Nesterov Date: Sat, 17 Aug 2024 19:57:14 +0200 Subject: [PATCH] [fix] call init Signed-off-by: Anton Nesterov --- pkg/facade/SQLiteServer.go | 1 + pkg/utils/sql.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/pkg/facade/SQLiteServer.go b/pkg/facade/SQLiteServer.go index 7c646c1..c609c1b 100644 --- a/pkg/facade/SQLiteServer.go +++ b/pkg/facade/SQLiteServer.go @@ -63,6 +63,7 @@ Serve starts the basic server on the configured port. Use `GetHandler` to get a handler for a custom server. */ func (s *SQLiteServer) Serve() { + s.Init() err := http.ListenAndServe(":"+s.Port, s.GetHandler()) if err != nil { panic(err) diff --git a/pkg/utils/sql.go b/pkg/utils/sql.go index 41fdaaa..33c313d 100644 --- a/pkg/utils/sql.go +++ b/pkg/utils/sql.go @@ -11,6 +11,11 @@ import ( "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) { buf := make([]byte, 0, len(sql)) argPos := 0