MCPcopy Create free account
hub / github.com/mattn/go-sqlite3 / TestSetFileControlInt64

Function TestSetFileControlInt64

sqlite3_test.go:2012–2036  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2010}
2011
2012func TestSetFileControlInt64(t *testing.T) {
2013 const GiB = 1024 * 1024 * 1024
2014
2015 t.Run("", func(t *testing.T) {
2016
2017 sql.Register("sqlite3_FCNTL_SIZE_LIMIT", &SQLiteDriver{
2018 ConnectHook: func(conn *SQLiteConn) error {
2019 if err := conn.SetFileControlInt64("", SQLITE_FCNTL_SIZE_LIMIT, 4*GiB); err != nil {
2020 return fmt.Errorf("Unexpected error from SetFileControlInt64(): %w", err)
2021 }
2022 return nil
2023 },
2024 })
2025
2026 db, err := sql.Open("sqlite3", "file:/dbname?vfs=memdb")
2027 if err != nil {
2028 t.Fatal("Failed to open database:", err)
2029 }
2030 err = db.Ping()
2031 if err != nil {
2032 t.Fatal("Failed to ping", err)
2033 }
2034 db.Close()
2035 })
2036}
2037
2038func TestNonColumnString(t *testing.T) {
2039 db, err := sql.Open("sqlite3", ":memory:")

Callers

nothing calls this directly

Calls 5

RunMethod · 0.80
SetFileControlInt64Method · 0.80
PingMethod · 0.80
OpenMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected