Skip to content

Commit

Permalink
CI: use libsql-server instead of sqld
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Jastrzebski <haaawk@gmail.com>
  • Loading branch information
haaawk committed Apr 16, 2024
1 parent a6656fe commit 6cff49f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

services:
sqld:
image: ghcr.io/libsql/sqld:latest
image: ghcr.io/tursodatabase/libsql-server:latest
ports:
- 8080:8080

Expand Down
14 changes: 7 additions & 7 deletions test/db_root_command_shell_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (s *DBRootCommandShellSuite) Test_GivenAEmptyTable_WhenCallDotDumpCommand_E
s.tc.Assert(errS, qt.Equals, "")
prefix := "PRAGMA foreign_keys=OFF;\nBEGIN TRANSACTION;\nCREATE TABLE"
if !strings.HasSuffix(s.dbUri, "test.sqlite") {
prefix += " if not exists libsql_wasm_func_table (name text primary key, body text) without rowid;\nCREATE TABLE if not exists"
prefix += " if not exists"
}
expected := " alltypes (textNullable text, textNotNullable text NOT NULL, textWithDefault text DEFAULT 'defaultValue', \n\tintNullable INTEGER, intNotNullable INTEGER NOT NULL, intWithDefault INTEGER DEFAULT '0', \n\tfloatNullable REAL, floatNotNullable REAL NOT NULL, floatWithDefault REAL DEFAULT '0.0', \n\tunknownNullable NUMERIC, unknownNotNullable NUMERIC NOT NULL, unknownWithDefault NUMERIC DEFAULT 0.0, \n\tblobNullable BLOB, blobNotNullable BLOB NOT NULL, blobWithDefault BLOB DEFAULT 'x\"0\"');\nCOMMIT;"
s.tc.AssertSqlEquals(outS, prefix+expected)
Expand All @@ -205,7 +205,7 @@ func (s *DBRootCommandShellSuite) Test_GivenATableConainingRandomFields_WhenInse

prefix := "PRAGMA foreign_keys=OFF;\nBEGIN TRANSACTION;\nCREATE TABLE"
if !strings.HasSuffix(s.dbUri, "test.sqlite") {
prefix += " if not exists libsql_wasm_func_table (name text primary key, body text) without rowid;\nCREATE TABLE if not exists"
prefix += " if not exists"
}
expected := " alltypes (t text, i integer, r real, b blob);\nINSERT INTO alltypes VALUES('text',99,3.14,X'0123456789ABCDEF');\nCOMMIT;"

Expand All @@ -223,7 +223,7 @@ func (s *DBRootCommandShellSuite) Test_GivenATableConainingFieldsWithALLTypes_Wh

prefix := "PRAGMA foreign_keys=OFF;\nBEGIN TRANSACTION;\nCREATE TABLE"
if !strings.HasSuffix(s.dbUri, "test.sqlite") {
prefix += " if not exists libsql_wasm_func_table (name text primary key, body text) without rowid;\nCREATE TABLE if not exists"
prefix += " if not exists"
}
expected := " alltypes (textNullable text, textNotNullable text NOT NULL, textWithDefault text DEFAULT 'defaultValue', \n\tintNullable INTEGER, intNotNullable INTEGER NOT NULL, intWithDefault INTEGER DEFAULT '0', \n\tfloatNullable REAL, floatNotNullable REAL NOT NULL, floatWithDefault REAL DEFAULT '0.0', \n\tunknownNullable NUMERIC, unknownNotNullable NUMERIC NOT NULL, unknownWithDefault NUMERIC DEFAULT 0.0, \n\tblobNullable BLOB, blobNotNullable BLOB NOT NULL, blobWithDefault BLOB DEFAULT 'x\"0\"');\nINSERT INTO alltypes VALUES(NULL,'text2','defaultValue',NULL,0,0,NULL,1.5,0,NULL,0,0,NULL,X'0123456789ABCDEF','x\"0\"');\nCOMMIT;"

Expand All @@ -242,7 +242,7 @@ func (s *DBRootCommandShellSuite) Test_GivenATableWithRecords_WhenCreateIndexAnd

prefix := "PRAGMA foreign_keys=OFF;\nBEGIN TRANSACTION;\nCREATE TABLE"
if !strings.HasSuffix(s.dbUri, "test.sqlite") {
prefix += " if not exists libsql_wasm_func_table (name text primary key, body text) without rowid;\nCREATE TABLE if not exists"
prefix += " if not exists"
}
expected := " alltypes (textNullable text, textNotNullable text NOT NULL, textWithDefault text DEFAULT 'defaultValue', \n\tintNullable INTEGER, intNotNullable INTEGER NOT NULL, intWithDefault INTEGER DEFAULT '0', \n\tfloatNullable REAL, floatNotNullable REAL NOT NULL, floatWithDefault REAL DEFAULT '0.0', \n\tunknownNullable NUMERIC, unknownNotNullable NUMERIC NOT NULL, unknownWithDefault NUMERIC DEFAULT 0.0, \n\tblobNullable BLOB, blobNotNullable BLOB NOT NULL, blobWithDefault BLOB DEFAULT 'x\"0\"');\nCREATE INDEX idx_textNullable on alltypes (textNullable);\nCREATE INDEX idx_intNotNullable on alltypes (intNotNullable) WHERE intNotNullable > 1;\nCOMMIT;"

Expand All @@ -261,7 +261,7 @@ func (s *DBRootCommandShellSuite) Test_GivenATableWithRecordsWithSingleQuote_Whe

prefix := "PRAGMA foreign_keys=OFF;\nBEGIN TRANSACTION;\nCREATE TABLE"
if !strings.HasSuffix(s.dbUri, "test.sqlite") {
prefix += " if not exists libsql_wasm_func_table (name text primary key, body text) without rowid;\nCREATE TABLE if not exists"
prefix += " if not exists"
}
expected := " t (id integer primary key, textfield text, intfield integer);\ninsert into t values(0,'x''x',0);\ncommit;"

Expand All @@ -277,7 +277,7 @@ func (s *DBRootCommandShellSuite) Test_GivenATableNameStartingWithNumber_WhenCal

prefix := "PRAGMA foreign_keys=OFF;\nBEGIN TRANSACTION;\nCREATE TABLE"
if !strings.HasSuffix(s.dbUri, "test.sqlite") {
prefix += " if not exists libsql_wasm_func_table (name text primary key, body text) without rowid;\nCREATE TABLE if not exists"
prefix += " if not exists"
}
expected := " \"8test\" (id integer primary key, textfield text, intfield integer);\ninsert into \"8test\" values(1,'value',1);\ncommit;"

Expand All @@ -293,7 +293,7 @@ func (s *DBRootCommandShellSuite) Test_GivenATableNameWithSpecialCharacters_When

prefix := "PRAGMA foreign_keys=OFF;\nBEGIN TRANSACTION;\nCREATE TABLE"
if !strings.HasSuffix(s.dbUri, "test.sqlite") {
prefix += " if not exists libsql_wasm_func_table (name text primary key, body text) without rowid;\nCREATE TABLE if not exists"
prefix += " if not exists"
}
expected := " \"t+e(s!t?\" (id integer primary key, textfield text, intfield integer);\ninsert into \"t+e(s!t?\" values(1,'value',1);\ncommit;"

Expand Down

0 comments on commit 6cff49f

Please sign in to comment.