Documentation ¶
Index ¶
- type MySQLAdapter
- func (adapter *MySQLAdapter) CreateSequencerTableIfNotExists(conn *sql.DB, tableName string) error
- func (adapter *MySQLAdapter) CurrentSequenceID(conn *sql.DB, tableName string) (int64, error)
- func (adapter *MySQLAdapter) ExecDDL(config *config.DatabaseConfig) error
- func (adapter *MySQLAdapter) InsertRowToSequencerIfNotExists(conn *sql.DB, tableName string) error
- func (adapter *MySQLAdapter) NextSequenceID(conn *sql.DB, tableName string) (int64, error)
- func (adapter *MySQLAdapter) OpenConnection(config *config.DatabaseConfig, queryString string) (*sql.DB, error)
- type SQLiteAdapter
- func (adapter *SQLiteAdapter) CreateSequencerTableIfNotExists(conn *sql.DB, tableName string) error
- func (adapter *SQLiteAdapter) CurrentSequenceID(conn *sql.DB, tableName string) (int64, error)
- func (adapter *SQLiteAdapter) ExecDDL(config *config.DatabaseConfig) error
- func (adapter *SQLiteAdapter) InsertRowToSequencerIfNotExists(conn *sql.DB, tableName string) error
- func (adapter *SQLiteAdapter) NextSequenceID(conn *sql.DB, tableName string) (int64, error)
- func (adapter *SQLiteAdapter) OpenConnection(config *config.DatabaseConfig, queryValues string) (*sql.DB, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQLAdapter ¶
type MySQLAdapter struct { }
MySQLAdapter implements DBAdapter interface.
func (*MySQLAdapter) CreateSequencerTableIfNotExists ¶
func (adapter *MySQLAdapter) CreateSequencerTableIfNotExists(conn *sql.DB, tableName string) error
CreateSequencerTableIfNotExists create table for sequencer if not exists
func (*MySQLAdapter) CurrentSequenceID ¶
CurrentSequenceID get current unique id for all shards by sequencer
func (*MySQLAdapter) ExecDDL ¶
func (adapter *MySQLAdapter) ExecDDL(config *config.DatabaseConfig) error
ExecDDL create database if not exists by database configuration file.
func (*MySQLAdapter) InsertRowToSequencerIfNotExists ¶
func (adapter *MySQLAdapter) InsertRowToSequencerIfNotExists(conn *sql.DB, tableName string) error
InsertRowToSequencerIfNotExists insert first row to sequencer if not exists
func (*MySQLAdapter) NextSequenceID ¶
NextSequenceID get next unique id for all shards by sequencer
func (*MySQLAdapter) OpenConnection ¶
func (adapter *MySQLAdapter) OpenConnection(config *config.DatabaseConfig, queryString string) (*sql.DB, error)
OpenConnection open connection by database configuration file
type SQLiteAdapter ¶
type SQLiteAdapter struct { }
SQLiteAdapter implements DBAdapter interface.
func (*SQLiteAdapter) CreateSequencerTableIfNotExists ¶
func (adapter *SQLiteAdapter) CreateSequencerTableIfNotExists(conn *sql.DB, tableName string) error
CreateSequencerTableIfNotExists create table for sequencer if not exists
func (*SQLiteAdapter) CurrentSequenceID ¶
CurrentSequenceID get current unique id for all shards by sequencer
func (*SQLiteAdapter) ExecDDL ¶
func (adapter *SQLiteAdapter) ExecDDL(config *config.DatabaseConfig) error
ExecDDL do nothing
func (*SQLiteAdapter) InsertRowToSequencerIfNotExists ¶
func (adapter *SQLiteAdapter) InsertRowToSequencerIfNotExists(conn *sql.DB, tableName string) error
InsertRowToSequencerIfNotExists insert first row to sequencer if not exists
func (*SQLiteAdapter) NextSequenceID ¶
NextSequenceID get next unique id for all shards by sequencer
func (*SQLiteAdapter) OpenConnection ¶
func (adapter *SQLiteAdapter) OpenConnection(config *config.DatabaseConfig, queryValues string) (*sql.DB, error)
OpenConnection open connection by database configuration file