plugin

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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

func (adapter *MySQLAdapter) CurrentSequenceID(conn *sql.DB, tableName string) (int64, error)

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

func (adapter *MySQLAdapter) NextSequenceID(conn *sql.DB, tableName string) (int64, error)

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

func (adapter *SQLiteAdapter) CurrentSequenceID(conn *sql.DB, tableName string) (int64, error)

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

func (adapter *SQLiteAdapter) NextSequenceID(conn *sql.DB, tableName string) (int64, error)

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

Jump to

Keyboard shortcuts

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