sqlite

package
v0.142.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The reduced number of kdf iterations (for performance reasons) which is
	// used as the default value
	// https://github.com/status-im/status-go/pull/1343
	// https://notes.status.im/i8Y_l7ccTiOYq09HVgoFwA
	ReducedKDFIterationsNumber = 3200

	// WALMode for sqlite.
	WALMode      = "wal"
	InMemoryPath = ":memory:"
)

Variables

This section is empty.

Functions

func ChangeEncryptionKey added in v0.80.2

func ChangeEncryptionKey(path string, key string, kdfIterationsNumber int, newKey string) error

func DecryptDB added in v0.69.0

func DecryptDB(oldPath string, newPath string, key string, kdfIterationsNumber int) error

DecryptDB completely removes the encryption from the db

func EncryptDB added in v0.69.0

func EncryptDB(unencryptedPath string, encryptedPath string, key string, kdfIterationsNumber int) error

EncryptDB takes a plaintext database and adds encryption

func Migrate

func Migrate(db *sql.DB, resources *bindata.AssetSource) error

Migrate database using provided resources.

func OpenDB

func OpenDB(path string, key string, kdfIterationsNumber int) (*sql.DB, error)

OpenDB opens not-encrypted database.

func OpenUnecryptedDB

func OpenUnecryptedDB(path string) (*sql.DB, error)

OpenUnecryptedDB opens database with setting PRAGMA key.

Types

type JSONBlob

type JSONBlob struct {
	Data interface{}
}

JSONBlob type for marshaling/unmarshaling inner type to json.

func (*JSONBlob) Scan

func (blob *JSONBlob) Scan(value interface{}) error

Scan implements interface.

func (*JSONBlob) Value

func (blob *JSONBlob) Value() (driver.Value, error)

Value implements interface.

Jump to

Keyboard shortcuts

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