Documentation
¶
Index ¶
- func MapScan(rows *sql.Rows, dest map[string]any, ...) error
- func MinMaxQuery(stream types.StreamInterface, column string) string
- func MinMaxQueryMySQL(stream types.StreamInterface, columns []string) string
- func MySQLDiscoverTablesQuery() string
- func MySQLMasterStatusQuery() string
- func MySQLMasterStatusQueryNew() string
- func MySQLPrimaryKeyQuery() string
- func MySQLTableColumnsQuery() string
- func MySQLTableRowsQuery() string
- func MySQLTableSchemaQuery() string
- func MySQLVersion(client *sqlx.DB) (int, int, error)
- func MysqlChunkScanQuery(stream types.StreamInterface, filterColumns []string, chunk types.Chunk) string
- func MysqlLimitOffsetScanQuery(stream types.StreamInterface, chunk types.Chunk) string
- func NextChunkEndQuery(stream types.StreamInterface, columns []string, chunkSize int64) string
- func NextRowIDQuery(stream types.StreamInterface, currentSCN string, ROWID string, chunkSize int64) string
- func OracleChunkScanQuery(stream types.StreamInterface, chunk types.Chunk) string
- func OracleCurrentSCNQuery() string
- func OracleEmptyCheckQuery(stream types.StreamInterface) string
- func OracleMinMaxCountQuery(stream types.StreamInterface, currentSCN string) string
- func OraclePrimaryKeyColummsQuery(schemaName, tableName string) string
- func OracleTableDetailsQuery(schemaName, tableName string) string
- func OracleTableSizeQuery(stream types.StreamInterface) string
- func PostgresChunkScanQuery(stream types.StreamInterface, filterColumn string, chunk types.Chunk) string
- func PostgresMinQuery(stream types.StreamInterface, filterColumn string, filterValue interface{}) string
- func PostgresNextChunkEndQuery(stream types.StreamInterface, filterColumn string, filterValue interface{}, ...) string
- func PostgresRelPageCount(stream types.StreamInterface) string
- func PostgresRowCountQuery(stream types.StreamInterface) string
- func PostgresWalLSNQuery() string
- func PostgresWithState(stream types.StreamInterface) string
- func PostgresWithoutState(stream types.StreamInterface) string
- func WithIsolation(ctx context.Context, client *sqlx.DB, fn func(tx *sql.Tx) error) error
- type Reader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MinMaxQuery ¶
func MinMaxQuery(stream types.StreamInterface, column string) string
MinMaxQuery returns the query to fetch MIN and MAX values of a column in a Postgres table
func MinMaxQueryMySQL ¶
func MinMaxQueryMySQL(stream types.StreamInterface, columns []string) string
MinMaxQueryMySQL returns the query to fetch MIN and MAX values of a column in a MySQL table
func MySQLDiscoverTablesQuery ¶
func MySQLDiscoverTablesQuery() string
MySQLDiscoverTablesQuery returns the query to discover tables in a MySQL database
func MySQLMasterStatusQuery ¶
func MySQLMasterStatusQuery() string
MySQLMasterStatusQuery returns the query to fetch the current binlog position in MySQL: mysql v8.3 and below
func MySQLMasterStatusQueryNew ¶
func MySQLMasterStatusQueryNew() string
MySQLMasterStatusQuery returns the query to fetch the current binlog position in MySQL: mysql v8.4 and above
func MySQLPrimaryKeyQuery ¶
func MySQLPrimaryKeyQuery() string
MySQLPrimaryKeyQuery returns the query to fetch the primary key column of a table in MySQL
func MySQLTableColumnsQuery ¶
func MySQLTableColumnsQuery() string
MySQLTableColumnsQuery returns the query to fetch column names of a table in MySQL
func MySQLTableRowsQuery ¶
func MySQLTableRowsQuery() string
MySQLTableRowsQuery returns the query to fetch the estimated row count of a table in MySQL
func MySQLTableSchemaQuery ¶
func MySQLTableSchemaQuery() string
MySQLTableSchemaQuery returns the query to fetch schema information for a table in MySQL
func MySQLVersion ¶
MySQLVersion returns the version of the MySQL server It returns the major and minor version of the MySQL server
func MysqlChunkScanQuery ¶
func MysqlChunkScanQuery(stream types.StreamInterface, filterColumns []string, chunk types.Chunk) string
MySQLWithoutState builds a chunk scan query for MySql
func MysqlLimitOffsetScanQuery ¶
func MysqlLimitOffsetScanQuery(stream types.StreamInterface, chunk types.Chunk) string
MysqlLimitOffsetScanQuery is used to get the rows
func NextChunkEndQuery ¶
func NextChunkEndQuery(stream types.StreamInterface, columns []string, chunkSize int64) string
NextChunkEndQuery returns the query to calculate the next chunk boundary Example: Input:
stream.Namespace() = "mydb"
stream.Name() = "users"
columns = []string{"id", "created_at"}
chunkSize = 1000
Output:
SELECT MAX(key_str) FROM (
SELECT CONCAT_WS(',', id, created_at) AS key_str
FROM `mydb`.`users`
WHERE (`id` > ?) OR (`id` = ? AND `created_at` > ?)
ORDER BY id, created_at
LIMIT 1000
) AS subquery
func NextRowIDQuery ¶ added in v0.1.3
func NextRowIDQuery(stream types.StreamInterface, currentSCN string, ROWID string, chunkSize int64) string
NextRowIDQuery returns the query to fetch the next max row id
func OracleChunkScanQuery ¶ added in v0.1.3
func OracleChunkScanQuery(stream types.StreamInterface, chunk types.Chunk) string
OracleChunkScanQuery returns the query to fetch the rows of a table in OracleDB
func OracleCurrentSCNQuery ¶ added in v0.1.3
func OracleCurrentSCNQuery() string
OracleCurrentSCNQuery returns the query to fetch the current SCN in OracleDB
func OracleEmptyCheckQuery ¶ added in v0.1.3
func OracleEmptyCheckQuery(stream types.StreamInterface) string
OracleEmptyCheckQuery returns the query to check if a table is empty in OracleDB
func OracleMinMaxCountQuery ¶ added in v0.1.3
func OracleMinMaxCountQuery(stream types.StreamInterface, currentSCN string) string
OracleMinMaxCountQuery returns the query to fetch the min ROWID, max ROWID and number of rows of a table in OracleDB
func OraclePrimaryKeyColummsQuery ¶ added in v0.1.3
OraclePrimaryKeyQuery returns the query to fetch all the primary key columns of a table in OracleDB
func OracleTableDetailsQuery ¶ added in v0.1.3
OracleTableDetailsQuery returns the query to fetch the details of a table in OracleDB
func OracleTableSizeQuery ¶ added in v0.1.3
func OracleTableSizeQuery(stream types.StreamInterface) string
OracleTableSizeQuery returns the query to fetch the size of a table in bytes in OracleDB
func PostgresChunkScanQuery ¶
func PostgresChunkScanQuery(stream types.StreamInterface, filterColumn string, chunk types.Chunk) string
PostgresBuildSplitScanQuery builds a chunk scan query for PostgreSQL
func PostgresMinQuery ¶
func PostgresMinQuery(stream types.StreamInterface, filterColumn string, filterValue interface{}) string
PostgresMinQuery returns the query to fetch the minimum value of a column in PostgreSQL
func PostgresNextChunkEndQuery ¶
func PostgresNextChunkEndQuery(stream types.StreamInterface, filterColumn string, filterValue interface{}, batchSize int) string
PostgresNextChunkEndQuery generates a SQL query to fetch the maximum value of a specified column
func PostgresRelPageCount ¶
func PostgresRelPageCount(stream types.StreamInterface) string
PostgresRelPageCount returns the query to fetch relation page count in PostgreSQL
func PostgresRowCountQuery ¶
func PostgresRowCountQuery(stream types.StreamInterface) string
PostgresRowCountQuery returns the query to fetch the estimated row count in PostgreSQL
func PostgresWalLSNQuery ¶
func PostgresWalLSNQuery() string
PostgresWalLSNQuery returns the query to fetch the current WAL LSN in PostgreSQL
func PostgresWithState ¶
func PostgresWithState(stream types.StreamInterface) string
PostgresWithState returns the query for a SELECT with state
func PostgresWithoutState ¶
func PostgresWithoutState(stream types.StreamInterface) string
PostgresWithoutState returns the query for a simple SELECT without state