aboutsummaryrefslogtreecommitdiff
path: root/tests/golite.go
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-10-04 18:28:34 -0300
committerEuAndreh <eu@euandre.org>2024-10-05 03:03:29 -0300
commitc7f1ec84eba5213ef5927b8c6300f43c47884da1 (patch)
tree3b2934d53fb4f13d6da07be5daccb9c3db0b4e43 /tests/golite.go
parentMakefile: Store and return bench timing data (diff)
downloadgolite-c7f1ec84eba5213ef5927b8c6300f43c47884da1.tar.gz
golite-c7f1ec84eba5213ef5927b8c6300f43c47884da1.tar.xz
Remove support for dynamically loading extensions
Defer to the user to (statically) include the extension with the rest of the code, and manually registering it, as described in [0]. If support for dynamic libraries and run-time dynamism in general is desired, one shouldn't be looking for it in C or Go, who aren't the greatest bastions of such dynamism, and instead consider more appropriate languages, like Common Lisp or Smalltalk. [0]: https://sqlite.org/loadext.html#statically_linking_a_run_time_loadable_extension
Diffstat (limited to '')
-rw-r--r--tests/golite.go52
1 files changed, 0 insertions, 52 deletions
diff --git a/tests/golite.go b/tests/golite.go
index 0747bce..aabe83c 100644
--- a/tests/golite.go
+++ b/tests/golite.go
@@ -1214,56 +1214,6 @@ func TestFileCopyTruncate(t *testing.T) {
}
}
-func TestExtensionsError(t *testing.T) {
- sql.Register("sqlite3_TestExtensionsError",
- &SQLiteDriver{
- Extensions: []string{
- "foobar",
- },
- },
- )
-
- db, err := sql.Open("sqlite3_TestExtensionsError", ":memory:")
- if err != nil {
- t.Fatal(err)
- }
- defer db.Close()
-
- err = db.Ping()
- if err == nil {
- t.Fatal("expected error loading non-existent extension")
- }
-
- if err.Error() == "not an error" {
- t.Fatal("expected error from sqlite3_enable_load_extension to be returned")
- }
-}
-
-func TestLoadExtensionError(t *testing.T) {
- sql.Register("sqlite3_TestLoadExtensionError",
- &SQLiteDriver{
- ConnectHook: func(c *SQLiteConn) error {
- return c.LoadExtension("foobar", "")
- },
- },
- )
-
- db, err := sql.Open("sqlite3_TestLoadExtensionError", ":memory:")
- if err != nil {
- t.Fatal(err)
- }
- defer db.Close()
-
- err = db.Ping()
- if err == nil {
- t.Fatal("expected error loading non-existent extension")
- }
-
- if err.Error() == "not an error" {
- t.Fatal("expected error from sqlite3_enable_load_extension to be returned")
- }
-}
-
func TestColumnTableName(t *testing.T) {
d := SQLiteDriver{}
conn, err := d.Open(":memory:")
@@ -3914,8 +3864,6 @@ func MainTest() {
{ "TestExecCancel", TestExecCancel },
{ "TestOpenContext", TestOpenContext },
{ "TestFileCopyTruncate", TestFileCopyTruncate },
- { "TestExtensionsError", TestExtensionsError },
- { "TestLoadExtensionError", TestLoadExtensionError },
{ "TestColumnTableName", TestColumnTableName },
{ "TestFTS3", TestFTS3 },
{ "TestFTS4", TestFTS4 },