connection

package
v0.0.0-...-9334841 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeURI

func EncodeURI(filename, query string) string

EncodeURI concatenates the given filename and query string, returning the full URI.

func OpenFollower

func OpenFollower(dsn string) (*sqlite3.SQLiteConn, error)

OpenFollower is a wrapper around SQLiteDriver.Open that opens connection in follower replication mode, and sets any additional dqlite-related options.

func OpenLeader

func OpenLeader(dsn string, methods sqlite3.ReplicationMethods) (*sqlite3.SQLiteConn, error)

OpenLeader is a wrapper around SQLiteDriver.Open that opens connection in leader replication mode, and sets any additional dqlite-related options.

The 'methods' argument is used to set the replication methods.

func ParseURI

func ParseURI(uri string) (string, string, error)

ParseURI parses the given sqlite3 URI checking if it's compatible with dqlite.

Only pure file names without any directory segment are accepted (e.g. "test.db"). Query parameters are always valid except for "mode=memory".

It returns the filename and query parameters.

func Restore

func Restore(path string, database []byte, wal []byte) error

Restore the given database and WAL backups, writing them at the given database path.

func Snapshot

func Snapshot(path string) ([]byte, []byte, error)

Snapshot returns a snapshot of the SQLite database with the given path.

The snapshot is comprised of two byte slices, one with the content of the database and one is the content of the WAL file.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL