Documentation
¶
Overview ¶
File is part of the build only if cgo is enabled. Otherwise, the compilation will complains about missing type sqlite3,Error It is due to the fact than sqlite lib use import "C" statement. The presence of these statement during the build exclude the file if CGO is disabled.
Index ¶
- Constants
- Variables
- func DriverModule(cfg ModuleConfig) fx.Option
- func NewPostgresDB(db *sql.DB) *postgresDB
- func NewSQLiteDB(directory, dbName string) *sqliteDB
- func OpenSQLDB(flavor Flavor, dataSourceName string) (*sql.DB, error)
- func SQLDriverName(f Flavor) string
- func UpdateSQLDriverMapping(flavor Flavor, name string)
- type DB
- type Driver
- func (d *Driver) Close(ctx context.Context) error
- func (s *Driver) DeleteStore(ctx context.Context, name string) error
- func (s *Driver) GetStore(ctx context.Context, name string, create bool) (storage.Store, bool, error)
- func (s *Driver) Initialize(ctx context.Context) error
- func (d *Driver) List(ctx context.Context) ([]string, error)
- func (s *Driver) Name() string
- func (d *Driver) Register(ctx context.Context, ledger string) (bool, error)
- type Flavor
- type ModuleConfig
- type PGSchema
- func (s *PGSchema) Close(ctx context.Context) error
- func (s *PGSchema) Delete(ctx context.Context) error
- func (s *PGSchema) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (s *PGSchema) Flavor() sqlbuilder.Flavor
- func (s *PGSchema) Initialize(ctx context.Context) error
- func (s *PGSchema) Name() string
- func (s *PGSchema) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (s *PGSchema) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- func (s *PGSchema) Table(name string) string
- type PostgresConfig
- type SQLiteConfig
- type SQLiteSchema
- func (s *SQLiteSchema) Close(ctx context.Context) error
- func (s SQLiteSchema) Delete(ctx context.Context) error
- func (s *SQLiteSchema) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (s SQLiteSchema) Flavor() sqlbuilder.Flavor
- func (s *SQLiteSchema) Initialize(ctx context.Context) error
- func (s *SQLiteSchema) Name() string
- func (s *SQLiteSchema) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (s *SQLiteSchema) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- func (s *SQLiteSchema) Table(name string) string
- type Schema
- type Store
- func (s *Store) AggregateVolumes(ctx context.Context, address string) (core.Volumes, error)
- func (s *Store) AppendLog(ctx context.Context, logs ...core.Log) (map[int]error, error)
- func (s *Store) Close(ctx context.Context) error
- func (s *Store) CountAccounts(ctx context.Context) (int64, error)
- func (s *Store) CountTransactions(ctx context.Context) (int64, error)
- func (s *Store) FindAccounts(ctx context.Context, q query.Query) (sharedapi.Cursor, error)
- func (s *Store) FindTransactions(ctx context.Context, q query.Query) (sharedapi.Cursor, error)
- func (s *Store) GetAccount(ctx context.Context, addr string) (core.Account, error)
- func (s *Store) GetTransaction(ctx context.Context, txId uint64) (tx core.Transaction, err error)
- func (s *Store) Initialize(ctx context.Context) (bool, error)
- func (s *Store) LastLog(ctx context.Context) (*core.Log, error)
- func (s *Store) LoadMapping(ctx context.Context) (*core.Mapping, error)
- func (s *Store) Logs(ctx context.Context) ([]core.Log, error)
- func (s *Store) Name() string
- func (s *Store) SaveMapping(ctx context.Context, mapping core.Mapping) error
- func (s *Store) Schema() Schema
Constants ¶
View Source
const SystemSchema = "_system"
Variables ¶
View Source
var ( SQLite = Flavor(sqlbuilder.SQLite) PostgreSQL = Flavor(sqlbuilder.PostgreSQL) )
View Source
var MigrationsFs fs.FS
Functions ¶
func DriverModule ¶
func DriverModule(cfg ModuleConfig) fx.Option
func NewPostgresDB ¶ added in v1.3.2
func NewSQLiteDB ¶ added in v1.3.2
func NewSQLiteDB(directory, dbName string) *sqliteDB
func SQLDriverName ¶
func UpdateSQLDriverMapping ¶
Types ¶
type Driver ¶ added in v1.3.2
type Driver struct {
// contains filtered or unexported fields
}
func (*Driver) DeleteStore ¶ added in v1.3.2
type Flavor ¶
type Flavor sqlbuilder.Flavor
func FlavorFromString ¶
func (Flavor) AttributeKeyValue ¶
type ModuleConfig ¶
type ModuleConfig struct { StorageDriver string SQLiteConfig *SQLiteConfig PostgresConfig *PostgresConfig }
type PGSchema ¶ added in v1.3.2
type PGSchema struct {
// contains filtered or unexported fields
}
func (*PGSchema) ExecContext ¶ added in v1.3.2
func (*PGSchema) Initialize ¶ added in v1.3.2
func (*PGSchema) QueryContext ¶ added in v1.3.2
func (*PGSchema) QueryRowContext ¶ added in v1.3.2
type PostgresConfig ¶
type PostgresConfig struct {
ConnString string
}
type SQLiteConfig ¶
type SQLiteSchema ¶ added in v1.3.2
type SQLiteSchema struct {
// contains filtered or unexported fields
}
func (SQLiteSchema) Delete ¶ added in v1.3.2
func (s SQLiteSchema) Delete(ctx context.Context) error
func (*SQLiteSchema) ExecContext ¶ added in v1.3.2
func (SQLiteSchema) Flavor ¶ added in v1.3.2
func (s SQLiteSchema) Flavor() sqlbuilder.Flavor
func (*SQLiteSchema) Initialize ¶ added in v1.3.2
func (*SQLiteSchema) QueryContext ¶ added in v1.3.2
func (*SQLiteSchema) QueryRowContext ¶ added in v1.3.2
type Schema ¶ added in v1.3.2
type Schema interface { Initialize(ctx context.Context) error Table(name string) string Close(ctx context.Context) error BeginTx(ctx context.Context, s *sql.TxOptions) (*sql.Tx, error) Flavor() sqlbuilder.Flavor Name() string Delete(ctx context.Context) error // contains filtered or unexported methods }
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AggregateVolumes ¶
func (*Store) CountTransactions ¶
func (*Store) FindAccounts ¶
func (*Store) FindTransactions ¶
func (*Store) GetAccount ¶ added in v1.3.2
func (*Store) GetTransaction ¶
func (*Store) SaveMapping ¶
Click to show internal directories.
Click to hide internal directories.