mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-12 05:59:14 +00:00
Tweaks.
This commit is contained in:
@@ -94,10 +94,10 @@ func newConnector(name string, init func(ctx context.Context, conn *sqlite3.Conn
|
|||||||
}
|
}
|
||||||
|
|
||||||
type connector struct {
|
type connector struct {
|
||||||
|
init func(ctx context.Context, conn *sqlite3.Conn) error
|
||||||
name string
|
name string
|
||||||
txlock string
|
txlock string
|
||||||
pragmas bool
|
pragmas bool
|
||||||
init func(ctx context.Context, conn *sqlite3.Conn) error
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *connector) Driver() driver.Driver {
|
func (n *connector) Driver() driver.Driver {
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ func (m *memFile) WriteAt(b []byte, off int64) (n int, err error) {
|
|||||||
n = copy((*m.data[base])[rest:], b)
|
n = copy((*m.data[base])[rest:], b)
|
||||||
if n < len(b) {
|
if n < len(b) {
|
||||||
// Assume writes are page aligned.
|
// Assume writes are page aligned.
|
||||||
return 0, io.ErrShortWrite
|
return n, io.ErrShortWrite
|
||||||
}
|
}
|
||||||
if size := off + int64(len(b)); size > m.size {
|
if size := off + int64(len(b)); size > m.size {
|
||||||
m.size = size
|
m.size = size
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ func Test_multiwrite01(t *testing.T) {
|
|||||||
|
|
||||||
func Test_config01_memory(t *testing.T) {
|
func Test_config01_memory(t *testing.T) {
|
||||||
ctx := util.NewContext(newContext(t))
|
ctx := util.NewContext(newContext(t))
|
||||||
cfg := config(ctx).WithArgs("mptest", "test.db",
|
cfg := config(ctx).WithArgs("mptest", "/test.db",
|
||||||
"config01.test",
|
"config01.test",
|
||||||
"--vfs", "memdb",
|
"--vfs", "memdb",
|
||||||
"--timeout", "1000")
|
"--timeout", "1000")
|
||||||
|
|||||||
Reference in New Issue
Block a user