CovenantSQL: github.com/CovenantSQL/CovenantSQL/sqlchain/adapter/storage Index | Files

package storage

import "github.com/CovenantSQL/CovenantSQL/sqlchain/adapter/storage"

Package storage defines the abstraction layer.

Index

Package Files

covenantsql.go doc.go sqlite3.go storage.go

type CovenantSQLStorage Uses

type CovenantSQLStorage struct {
    // contains filtered or unexported fields
}

CovenantSQLStorage defines the covenantsql database abstraction.

func NewCovenantSQLStorage Uses

func NewCovenantSQLStorage(mirrorServerAddr string) (s *CovenantSQLStorage)

NewCovenantSQLStorage returns new covenantsql storage handler.

func (*CovenantSQLStorage) Create Uses

func (s *CovenantSQLStorage) Create(nodeCnt int) (dbID string, err error)

Create implements the Storage abstraction interface.

func (*CovenantSQLStorage) Drop Uses

func (s *CovenantSQLStorage) Drop(dbID string) (err error)

Drop implements the Storage abstraction interface.

func (*CovenantSQLStorage) Exec Uses

func (s *CovenantSQLStorage) Exec(dbID string, query string, args ...interface{}) (affectedRows int64, lastInsertID int64, err error)

Exec implements the Storage abstraction interface.

func (*CovenantSQLStorage) Query Uses

func (s *CovenantSQLStorage) Query(dbID string, query string, args ...interface{}) (columns []string, types []string, result [][]interface{}, err error)

Query implements the Storage abstraction interface.

type SQLite3Storage Uses

type SQLite3Storage struct {
    // contains filtered or unexported fields
}

SQLite3Storage defines the sqlite3 database abstraction.

func NewSQLite3Storage Uses

func NewSQLite3Storage(rootDir string) (s *SQLite3Storage, err error)

NewSQLite3Storage returns the sqlite3 storage abstraction.

func (*SQLite3Storage) Create Uses

func (s *SQLite3Storage) Create(nodeCnt int) (dbID string, err error)

Create implements the Storage abstraction interface.

func (*SQLite3Storage) Drop Uses

func (s *SQLite3Storage) Drop(dbID string) (err error)

Drop implements the Storage abstraction interface.

func (*SQLite3Storage) Exec Uses

func (s *SQLite3Storage) Exec(dbID string, query string, args ...interface{}) (affectedRows int64, lastInsertID int64, err error)

Exec implements the Storage abstraction interface.

func (*SQLite3Storage) Query Uses

func (s *SQLite3Storage) Query(dbID string, query string, args ...interface{}) (columns []string, types []string, result [][]interface{}, err error)

Query implements the Storage abstraction interface.

type Storage Uses

type Storage interface {
    // Create operation.
    Create(nodeCnt int) (dbID string, err error)
    // Drop operation.
    Drop(dbID string) (err error)
    // Query for result.
    Query(dbID string, query string, args ...interface{}) (columns []string, types []string, rows [][]interface{}, err error)
    // Exec for update.
    Exec(dbID string, query string, args ...interface{}) (affectedRows int64, lastInsertID int64, err error)
}

Storage defines the storage abstraction layer interface.

Package storage imports 10 packages (graph) and is imported by 2 packages. Updated 2019-03-25. Refresh now. Tools for package owners.