diff options
| author | EuAndreh <eu@euandre.org> | 2024-10-18 17:54:26 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2024-10-20 03:36:18 -0300 |
| commit | f00c41fd4e6af8cd0db80c118a3bb4abef09604e (patch) | |
| tree | 46ad14d55cfe591691cf214076e8aea81edbfe18 /tests/functional/limit | |
| parent | .gitignore: Remove .so (diff) | |
| download | golite-f00c41fd4e6af8cd0db80c118a3bb4abef09604e.tar.gz golite-f00c41fd4e6af8cd0db80c118a3bb4abef09604e.tar.xz | |
Shoehorn project into default golang skeleton structure
Diffstat (limited to '')
| -rw-r--r-- | tests/functional/limit/acudego.go (renamed from tests/functional/limit.go) | 20 | ||||
| l--------- | tests/functional/limit/main.go | 1 |
2 files changed, 12 insertions, 9 deletions
diff --git a/tests/functional/limit.go b/tests/functional/limit/acudego.go index ab726f6..d47dc27 100644 --- a/tests/functional/limit.go +++ b/tests/functional/limit/acudego.go @@ -1,4 +1,4 @@ -package main +package acudego import ( "database/sql" @@ -6,10 +6,10 @@ import ( "log" "os" "strings" - - "acudego" ) + + func createBulkInsertQuery(n int, start int) (string, []any) { values := make([]string, n) args := make([]any, n*2) @@ -37,7 +37,9 @@ func bulkInsert(db *sql.DB, query string, args []any) error { return err } -func main() { + + +func MainTest() { const ( num = 400 smallLimit = 100 @@ -49,9 +51,9 @@ func main() { delete from mylimittable; ` - var conn *acudego.SQLiteConn - sql.Register("sqlite3_with_limit", &acudego.SQLiteDriver{ - ConnectHook: func(c *acudego.SQLiteConn) error { + var conn *SQLiteConn + sql.Register("sqlite3_with_limit", &SQLiteDriver{ + ConnectHook: func(c *SQLiteConn) error { conn = c return nil }, @@ -82,7 +84,7 @@ func main() { } } - conn.SetLimit(acudego.SQLITE_LIMIT_VARIABLE_NUMBER, smallLimit) + conn.SetLimit(SQLITE_LIMIT_VARIABLE_NUMBER, smallLimit) { query, args := createBulkInsertQuery(num, num) err := bulkInsert(db, query, args) @@ -91,7 +93,7 @@ func main() { } } - conn.SetLimit(acudego.SQLITE_LIMIT_VARIABLE_NUMBER, bigLimit) + conn.SetLimit(SQLITE_LIMIT_VARIABLE_NUMBER, bigLimit) { query, args := createBulkInsertQuery(500, num+num) err := bulkInsert(db, query, args) diff --git a/tests/functional/limit/main.go b/tests/functional/limit/main.go new file mode 120000 index 0000000..f67563d --- /dev/null +++ b/tests/functional/limit/main.go @@ -0,0 +1 @@ +../../main.go
\ No newline at end of file |
