sqliteuri

package
v0.0.0-...-f57fae0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoVacuum

type AutoVacuum string
const AutoVacuumFull AutoVacuum = "full"
const AutoVacuumIncremental AutoVacuum = "incremental"
const AutoVacuumNone AutoVacuum = "none"

type Bool

type Bool string
const False Bool = "false"
const True Bool = "true"

type Cache

type Cache string
const CachePrivate Cache = "private"

"private" is equivalent to setting the SQLITE_OPEN_PRIVATECACHE bit.

const CacheShared Cache = "shared"

"shared" is equivalent to setting the SQLITE_OPEN_SHAREDCACHE bit in the flags argument passed to sqlite3_open_v2()

type Crypt

type Crypt string
const CryptSHA1 Crypt = "SHA1"
const CryptSHA256 Crypt = "SHA256"
const CryptSHA384 Crypt = "SHA384"
const CryptSHA512 Crypt = "SHA512"
const CryptSSHA1 Crypt = "SSHA1"
const CryptSSHA256 Crypt = "SSHA256"
const CryptSSHA384 Crypt = "SSHA384"
const CryptSSHA512 Crypt = "SSHA512"

type ExtraURIOption

type ExtraURIOption struct {
	Name  string
	Value string
}

type Int

type Int string

func AsInt

func AsInt(i int) Int

type JournalMode

type JournalMode string
const JournalModeDelete JournalMode = "DELETE"
const JournalModeMemory JournalMode = "MEMORY"
const JournalModeOff JournalMode = "OFF"
const JournalModePersist JournalMode = "PERSIST"
const JournalModeTruncate JournalMode = "TRUNCATE"
const JournalModeWAL JournalMode = "WAL"

type LockingMode

type LockingMode string
const LockingModeExclusive LockingMode = "EXCLUSIVE"
const LockingModeNormal LockingMode = "NORMAL"

type Mode

type Mode string
const ModeMemory Mode = "memory"

If the mode option is set to "memory" then a pure in-memory database that never reads or writes from disk is used.

const ModeReadOnly Mode = "ro"

The database is opened for read-only access, just as if the SQLITE_OPEN_READONLY flag had been set in the third argument to sqlite3_open_v2().

const ModeReadWrite Mode = "rw"

If the mode option is set to "rw", then the database is opened for read-write (but not create) access, as if SQLITE_OPEN_READWRITE (but not SQLITE_OPEN_CREATE) had been set.

const ModeReadWriteCreate Mode = "rwc"

Value "rwc" is equivalent to setting both SQLITE_OPEN_READWRITE and SQLITE_OPEN_CREATE.

type MutexMode

type MutexMode string
const MutexModeFull MutexMode = "full"
const MutexModeNo MutexMode = "no"

type SecureDelete

type SecureDelete string
const SecureDeleteFast SecureDelete = "fast"
const SecureDeleteNo SecureDelete = "false"
const SecureDeleteYes SecureDelete = "true"

type Synchronous

type Synchronous string
const SynchronousExtra Synchronous = "EXTRA"
const SynchronousFull Synchronous = "FULL"
const SynchronousNormal Synchronous = "NORMAL"
const SynchronousOff Synchronous = "OFF"

type TxLock

type TxLock string
const TxLocDeferred TxLock = "deferred"
const TxLocExclusive TxLock = "exclusive"
const TxLocImmediate TxLock = "immediate"

type URI

type URI struct {
	FileName string

	URIOptions
}

func (*URI) AttachTo

func (uri *URI) AttachTo(ctx context.Context, db *sql.DB, name string) error

func (*URI) Open

func (uri *URI) Open() (*sql.DB, error)

func (*URI) String

func (uri *URI) String() string

type URIOptions

type URIOptions struct {
	VFS       string `query:"vfs"`       // The "vfs" parameter may be used to specify the name of a VFS object that provides the operating system interface that should be used to access the database file on disk. If this option is set to an empty string the default VFS object is used. Specifying an unknown VFS is an error. If sqlite3_open_v2() is used and the vfs option is present, then the VFS specified by the option takes precedence over the value passed as the fourth parameter to sqlite3_open_v2().
	Mode      Mode   `query:"mode"`      // It is an error to specify a value for the mode parameter that is less restrictive than that specified by the flags passed in the third parameter to sqlite3_open_v2().
	Cache     Cache  `query:"cache"`     // If sqlite3_open_v2() is used and the "cache" parameter is present in a URI filename, its value overrides any behavior requested by setting SQLITE_OPEN_PRIVATECACHE or SQLITE_OPEN_SHAREDCACHE flag.
	PSOW      Bool   `query:"psow"`      // The psow parameter indicates whether or not the powersafe overwrite property does or does not apply to the storage media on which the database file resides.
	NoLock    Bool   `query:"nolock"`    // The nolock parameter is a boolean query parameter which if set disables file locking in rollback journal modes. This is useful for accessing a database on a filesystem that does not support locking. Caution: Database corruption might result if two or more processes write to the same database and any one of those processes uses nolock=1.
	Immutable Bool   `query:"immutable"` // The immutable parameter is a boolean query parameter that indicates that the database file is stored on read-only media. When immutable is set, SQLite assumes that the database file cannot be changed, even by a process with higher privilege, and so the database is opened read-only and all locking and change detection is disabled. Caution: Setting the immutable property on a database file that does in fact change can result in incorrect query results and/or SQLITE_CORRUPT errors. See also: SQLITE_IOCAP_IMMUTABLE.

	// _auth // UA -" Create; Create User Authentication, for more information see User Authentication
	AuthUser               string      `query:"_auth_user"`                // UA - Username; Username for User Authentication, for more information see User Authentication
	AuthPass               string      `query:"_auth_pass"`                // UA - Password; Password for User Authentication, for more information see User Authentication
	AuthCrypt              Crypt       `query:"_auth_crypt"`               // UA - Crypt; Password encoder to use for User Authentication, for more information see User Authentication
	AuthSalt               string      `query:"_auth_salt"`                // UA - Salt; Salt to use if the configure password encoder requires a salt, for User Authentication, for more information see User Authentication
	AutoVacuum             AutoVacuum  `query:"_auto_vacuum"`              // Auto Vacuum; For more information see PRAGMA autoVacuum
	BusyTimeout            Int         `query:"_busy_timeout"`             // Busy Timeout; Specify value for sqlite3_busy_timeout. For more information see PRAGMA busy_timeout
	CaseSensitiveLike      Bool        `query:"_case_sensitive_like"`      // Case Sensitive LIKE; For more information see PRAGMA case_sensitive_like
	DeferForeignKeys       Bool        `query:"_defer_foreign_keys"`       // Defer Foreign Keys; For more information see PRAGMA defer_foreign_keys
	ForeignKeys            Bool        `query:"_foreign_keys"`             // Foreign Keys; For more information see PRAGMA foreign_keys
	IgnoreCheckConstraints Bool        `query:"_ignore_check_constraints"` // Ignore CHECK Constraints; For more information see PRAGMA ignore_check_constraints
	JournalMode            JournalMode `query:"_journal_mode"`             // Journal Mode; For more information see PRAGMA journal_mode
	LockingMode            LockingMode `query:"_locking_mode"`             // Locking Mode; For more information see PRAGMA locking_mode
	Mutex                  MutexMode   `query:"_mutex"`                    // Mutex Locking; Specify mutex mode.
	QueryOnly              Bool        `query:"_query_only"`               // Query Only; For more information see PRAGMA query_only
	RecursiveTriggers      Bool        `query:"_recursive_triggers"`       // Recursive Triggers; For more information see PRAGMA recursive_triggers
	SecureDelete           Bool        `query:"_secure_delete"`            // Secure Delete; For more information see PRAGMA secure_delete
	Synchronous            Synchronous `query:"_synchronous"`              // Synchronous; For more information see PRAGMA synchronous

	// _loc TZLocation `query:"_loc"` // Time Zone Location; Specify location of time format.
	Txlock         TxLock `query:"_txlock"`          // Transaction Lock; Specify locking behavior for transactions.
	WritableSchema Bool   `query:"_writable_schema"` // Writable Schema; When this pragma is on, the SQLITE_MASTER tables in which database can be changed using ordinary UPDATE, INSERT, and DELETE statements. Warning: misuse of this pragma can easily result in a corrupt database file.
	CacheSize      Int    `query:"_cache_size"`      // Cache Size; Maximum cache size; default is 2000K (2M). See PRAGMA cache_size

	Extras []ExtraURIOption
}

func (*URIOptions) String

func (opts *URIOptions) String() string

Jump to

Keyboard shortcuts

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