Documentation
¶
Index ¶
- func ExtractPrimaryTableFromJoin(sqlQuery string) string
- func ExtractTableNameFromSQL(sqlQuery string) string
- func FormatTableData(rows *sql.Rows) (columns []string, data [][]string, err error)
- func FormatTableDataWithTypes(rows *sql.Rows) (columns []string, columnTypes []string, data [][]string, err error)
- func GetNextQueryId(queries map[string]Query) (id int)
- func GetSupportedDBTypes() []string
- func HasJoinClause(sqlQuery string) bool
- func InferDBType(connString string) string
- type BaseConnection
- func (b *BaseConnection) ApplyRowLimit(sql string, limit int) string
- func (b *BaseConnection) BuildDeleteStatement(tableName, primaryKeyCol, pkValue string) string
- func (b *BaseConnection) BuildUpdateStatement(tableName, columnName, currentValue, pkColumn, pkValue string) string
- func (b *BaseConnection) Close() error
- func (b *BaseConnection) Exec(sql string, args ...any) error
- func (b *BaseConnection) ExecQuery(sql string, args ...any) (*sql.Rows, error)
- func (b *BaseConnection) GetConnString() string
- func (b *BaseConnection) GetDbType() string
- func (b *BaseConnection) GetForeignKeys(tableName string) ([]ForeignKey, error)
- func (b *BaseConnection) GetForeignKeysReferencingTable(tableName string) ([]ForeignKey, error)
- func (b *BaseConnection) GetInfoSQL(infoType string) string
- func (b *BaseConnection) GetLastQuery() Query
- func (b *BaseConnection) GetName() string
- func (b *BaseConnection) GetPlaceholder(paramIndex int) string
- func (b *BaseConnection) GetQueries() map[string]Query
- func (b *BaseConnection) GetSchema() string
- func (b *BaseConnection) GetTableMetadata(tableName string) (*TableMetadata, error)
- func (b *BaseConnection) GetTables() ([]string, error)
- func (b *BaseConnection) GetViews() ([]string, error)
- func (b *BaseConnection) Open() error
- func (b *BaseConnection) Ping() error
- func (b *BaseConnection) Query(name string, args ...any) (any, error)
- func (b *BaseConnection) SetLastQuery(query Query)
- func (b *BaseConnection) SetQueries(queries map[string]Query)
- func (b *BaseConnection) SetSchema(schema string)
- type ClickHouseConnection
- func (c *ClickHouseConnection) ApplyRowLimit(sql string, limit int) string
- func (c *ClickHouseConnection) BuildDeleteStatement(tableName, primaryKeyCol, pkValue string) string
- func (c *ClickHouseConnection) BuildUpdateStatement(tableName, columnName, currentValue, pkColumn, pkValue string) string
- func (c *ClickHouseConnection) Close() error
- func (c *ClickHouseConnection) Exec(sql string, args ...any) error
- func (c *ClickHouseConnection) ExecQuery(sql string, args ...any) (*sql.Rows, error)
- func (c *ClickHouseConnection) GetForeignKeys(tableName string) ([]ForeignKey, error)
- func (c *ClickHouseConnection) GetForeignKeysReferencingTable(tableName string) ([]ForeignKey, error)
- func (c *ClickHouseConnection) GetInfoSQL(infoType string) string
- func (c *ClickHouseConnection) GetPlaceholder(paramIndex int) string
- func (c *ClickHouseConnection) GetTableMetadata(tableName string) (*TableMetadata, error)
- func (c *ClickHouseConnection) GetTables() ([]string, error)
- func (c *ClickHouseConnection) GetUniqueConstraints(tableName string) ([]string, error)
- func (c *ClickHouseConnection) GetViews() ([]string, error)
- func (c *ClickHouseConnection) Open() error
- func (c *ClickHouseConnection) Ping() error
- func (c *ClickHouseConnection) Query(queryName string, args ...any) (any, error)
- type Connection
- type DatabaseConnection
- type FirebirdConnection
- func (f *FirebirdConnection) ApplyRowLimit(sqlStr string, limit int) string
- func (f *FirebirdConnection) BuildDeleteStatement(tableName, primaryKeyCol, pkValue string) string
- func (f *FirebirdConnection) Close() error
- func (f *FirebirdConnection) Exec(sqlStr string, args ...any) error
- func (f *FirebirdConnection) ExecQuery(sqlStr string, args ...any) (*sql.Rows, error)
- func (f *FirebirdConnection) GetForeignKeys(tableName string) ([]ForeignKey, error)
- func (f *FirebirdConnection) GetForeignKeysReferencingTable(tableName string) ([]ForeignKey, error)
- func (f *FirebirdConnection) GetInfoSQL(infoType string) string
- func (f *FirebirdConnection) GetPlaceholder(paramIndex int) string
- func (f *FirebirdConnection) GetTableMetadata(tableName string) (*TableMetadata, error)
- func (f *FirebirdConnection) GetTables() ([]string, error)
- func (f *FirebirdConnection) GetUniqueConstraints(tableName string) ([]string, error)
- func (f *FirebirdConnection) GetViews() ([]string, error)
- func (f *FirebirdConnection) Open() error
- func (f *FirebirdConnection) Ping() error
- func (f *FirebirdConnection) Query(queryName string, args ...any) (any, error)
- func (f *FirebirdConnection) SetSchema(schema string)
- type ForeignKey
- type MySQLConnection
- func (m *MySQLConnection) BuildDeleteStatement(tableName, primaryKeyCol, pkValue string) string
- func (m *MySQLConnection) BuildUpdateStatement(tableName, columnName, currentValue, pkColumn, pkValue string) string
- func (m *MySQLConnection) Close() error
- func (m *MySQLConnection) Exec(sql string, args ...any) error
- func (m *MySQLConnection) ExecQuery(sql string, args ...any) (*sql.Rows, error)
- func (m *MySQLConnection) GetForeignKeys(tableName string) ([]ForeignKey, error)
- func (m *MySQLConnection) GetForeignKeysReferencingTable(tableName string) ([]ForeignKey, error)
- func (m *MySQLConnection) GetInfoSQL(infoType string) string
- func (m *MySQLConnection) GetPlaceholder(paramIndex int) string
- func (m *MySQLConnection) GetTableMetadata(tableName string) (*TableMetadata, error)
- func (m *MySQLConnection) GetTables() ([]string, error)
- func (m *MySQLConnection) GetUniqueConstraints(tableName string) ([]string, error)
- func (m *MySQLConnection) GetViews() ([]string, error)
- func (m *MySQLConnection) Open() error
- func (m *MySQLConnection) Ping() error
- func (m *MySQLConnection) Query(queryName string, args ...any) (any, error)
- type OracleConnection
- func (oc *OracleConnection) ApplyRowLimit(sql string, limit int) string
- func (oc *OracleConnection) BuildDeleteStatement(tableName, primaryKeyCol, pkValue string) string
- func (oc *OracleConnection) BuildUpdateStatement(tableName, columnName, currentValue, pkColumn, pkValue string) string
- func (oc *OracleConnection) Close() error
- func (oc *OracleConnection) Exec(sql string, args ...any) error
- func (oc *OracleConnection) ExecQuery(sql string, args ...any) (*sql.Rows, error)
- func (oc *OracleConnection) GetForeignKeys(tableName string) ([]ForeignKey, error)
- func (oc *OracleConnection) GetForeignKeysReferencingTable(tableName string) ([]ForeignKey, error)
- func (oc *OracleConnection) GetInfoSQL(infoType string) string
- func (oc *OracleConnection) GetPlaceholder(paramIndex int) string
- func (oc *OracleConnection) GetTableMetadata(tableName string) (*TableMetadata, error)
- func (oc *OracleConnection) GetTables() ([]string, error)
- func (oc *OracleConnection) GetUniqueConstraints(tableName string) ([]string, error)
- func (oc *OracleConnection) GetViews() ([]string, error)
- func (oc *OracleConnection) Open() error
- func (oc *OracleConnection) Ping() error
- func (oc *OracleConnection) Query(queryName string, args ...any) (any, error)
- type PostgresConnection
- func (c *PostgresConnection) BuildDeleteStatement(tableName, primaryKeyCol, pkValue string) string
- func (p *PostgresConnection) BuildUpdateStatement(tableName, columnName, currentValue, pkColumn, pkValue string) string
- func (p *PostgresConnection) Close() error
- func (p *PostgresConnection) Exec(sql string, args ...any) error
- func (p *PostgresConnection) ExecQuery(sql string, args ...any) (*sql.Rows, error)
- func (p *PostgresConnection) GetForeignKeys(tableName string) ([]ForeignKey, error)
- func (p *PostgresConnection) GetForeignKeysReferencingTable(tableName string) ([]ForeignKey, error)
- func (p *PostgresConnection) GetInfoSQL(infoType string) string
- func (p *PostgresConnection) GetPlaceholder(paramIndex int) string
- func (p *PostgresConnection) GetTableMetadata(tableName string) (*TableMetadata, error)
- func (p *PostgresConnection) GetTables() ([]string, error)
- func (p *PostgresConnection) GetUniqueConstraints(tableName string) ([]string, error)
- func (p *PostgresConnection) GetViews() ([]string, error)
- func (p *PostgresConnection) Open() error
- func (oc *PostgresConnection) Ping() error
- func (p *PostgresConnection) Query(queryName string, args ...any) (any, error)
- type Query
- type SQLServerConnection
- func (s *SQLServerConnection) ApplyRowLimit(sql string, limit int) string
- func (s *SQLServerConnection) BuildDeleteStatement(tableName, primaryKeyCol, pkValue string) string
- func (s *SQLServerConnection) BuildUpdateStatement(tableName, columnName, currentValue, pkColumn, pkValue string) string
- func (s *SQLServerConnection) Close() error
- func (s *SQLServerConnection) Exec(sql string, args ...any) error
- func (s *SQLServerConnection) ExecQuery(sql string, args ...any) (*sql.Rows, error)
- func (s *SQLServerConnection) GetForeignKeys(tableName string) ([]ForeignKey, error)
- func (s *SQLServerConnection) GetForeignKeysReferencingTable(tableName string) ([]ForeignKey, error)
- func (s *SQLServerConnection) GetInfoSQL(infoType string) string
- func (s *SQLServerConnection) GetPlaceholder(paramIndex int) string
- func (s *SQLServerConnection) GetTableMetadata(tableName string) (*TableMetadata, error)
- func (s *SQLServerConnection) GetTables() ([]string, error)
- func (s *SQLServerConnection) GetUniqueConstraints(tableName string) ([]string, error)
- func (s *SQLServerConnection) GetViews() ([]string, error)
- func (s *SQLServerConnection) Open() error
- func (s *SQLServerConnection) Ping() error
- func (s *SQLServerConnection) Query(queryName string, args ...any) (any, error)
- type SQLiteConnection
- func (s *SQLiteConnection) BuildDeleteStatement(tableName, primaryKeyCol, pkValue string) string
- func (s *SQLiteConnection) BuildUpdateStatement(tableName, columnName, currentValue, pkColumn, pkValue string) string
- func (s *SQLiteConnection) Close() error
- func (s *SQLiteConnection) Exec(sql string, args ...any) error
- func (s *SQLiteConnection) ExecQuery(sql string, args ...any) (*sql.Rows, error)
- func (s *SQLiteConnection) GetForeignKeys(tableName string) ([]ForeignKey, error)
- func (s *SQLiteConnection) GetForeignKeysReferencingTable(tableName string) ([]ForeignKey, error)
- func (s *SQLiteConnection) GetInfoSQL(infoType string) string
- func (s *SQLiteConnection) GetPlaceholder(paramIndex int) string
- func (s *SQLiteConnection) GetTableMetadata(tableName string) (*TableMetadata, error)
- func (s *SQLiteConnection) GetTables() ([]string, error)
- func (s *SQLiteConnection) GetUniqueConstraints(tableName string) ([]string, error)
- func (s *SQLiteConnection) GetViews() ([]string, error)
- func (s *SQLiteConnection) Open() error
- func (s *SQLiteConnection) Ping() error
- func (s *SQLiteConnection) Query(queryName string, args ...any) (any, error)
- type TableMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTableNameFromSQL ¶
func FormatTableData ¶
func GetNextQueryId ¶
func GetSupportedDBTypes ¶
func GetSupportedDBTypes() []string
GetSupportedDBTypes returns a list of all supported database types.
func HasJoinClause ¶
func InferDBType ¶
InferDBType attempts to infer the database type from a connection string. Returns the detected type or empty string if unable to infer.
Types ¶
type BaseConnection ¶
type BaseConnection struct {
Name string
DbType string
ConnString string
Schema string
Queries map[string]Query
LastQuery Query
}
func (*BaseConnection) ApplyRowLimit ¶
func (b *BaseConnection) ApplyRowLimit(sql string, limit int) string
func (*BaseConnection) BuildDeleteStatement ¶
func (b *BaseConnection) BuildDeleteStatement(tableName, primaryKeyCol, pkValue string) string
func (*BaseConnection) BuildUpdateStatement ¶
func (b *BaseConnection) BuildUpdateStatement( tableName, columnName, currentValue, pkColumn, pkValue string, ) string
func (*BaseConnection) Close ¶
func (b *BaseConnection) Close() error
func (*BaseConnection) GetConnString ¶
func (b *BaseConnection) GetConnString() string
func (*BaseConnection) GetDbType ¶
func (b *BaseConnection) GetDbType() string
func (*BaseConnection) GetForeignKeys ¶
func (b *BaseConnection) GetForeignKeys(tableName string) ([]ForeignKey, error)
func (*BaseConnection) GetForeignKeysReferencingTable ¶
func (b *BaseConnection) GetForeignKeysReferencingTable(tableName string) ([]ForeignKey, error)
func (*BaseConnection) GetInfoSQL ¶
func (b *BaseConnection) GetInfoSQL(infoType string) string
func (*BaseConnection) GetLastQuery ¶
func (b *BaseConnection) GetLastQuery() Query
func (*BaseConnection) GetName ¶
func (b *BaseConnection) GetName() string
func (*BaseConnection) GetPlaceholder ¶
func (b *BaseConnection) GetPlaceholder(paramIndex int) string
func (*BaseConnection) GetQueries ¶
func (b *BaseConnection) GetQueries() map[string]Query
func (*BaseConnection) GetSchema ¶
func (b *BaseConnection) GetSchema() string
func (*BaseConnection) GetTableMetadata ¶
func (b *BaseConnection) GetTableMetadata( tableName string, ) (*TableMetadata, error)
func (*BaseConnection) GetTables ¶
func (b *BaseConnection) GetTables() ([]string, error)
func (*BaseConnection) GetViews ¶
func (b *BaseConnection) GetViews() ([]string, error)
func (*BaseConnection) Open ¶
func (b *BaseConnection) Open() error
func (*BaseConnection) Ping ¶
func (b *BaseConnection) Ping() error
func (*BaseConnection) Query ¶
func (b *BaseConnection) Query(name string, args ...any) (any, error)
func (*BaseConnection) SetLastQuery ¶
func (b *BaseConnection) SetLastQuery( query Query, )
func (*BaseConnection) SetQueries ¶
func (b *BaseConnection) SetQueries( queries map[string]Query, )
func (*BaseConnection) SetSchema ¶
func (b *BaseConnection) SetSchema( schema string, )
type ClickHouseConnection ¶
type ClickHouseConnection struct {
*BaseConnection
// contains filtered or unexported fields
}
func NewClickHouseConnection ¶
func NewClickHouseConnection(name, connStr string) (*ClickHouseConnection, error)
func (*ClickHouseConnection) ApplyRowLimit ¶
func (c *ClickHouseConnection) ApplyRowLimit(sql string, limit int) string
func (*ClickHouseConnection) BuildDeleteStatement ¶
func (c *ClickHouseConnection) BuildDeleteStatement(tableName, primaryKeyCol, pkValue string) string
func (*ClickHouseConnection) BuildUpdateStatement ¶
func (c *ClickHouseConnection) BuildUpdateStatement(tableName, columnName, currentValue, pkColumn, pkValue string) string
func (*ClickHouseConnection) Close ¶
func (c *ClickHouseConnection) Close() error
func (*ClickHouseConnection) Exec ¶
func (c *ClickHouseConnection) Exec(sql string, args ...any) error
func (*ClickHouseConnection) GetForeignKeys ¶
func (c *ClickHouseConnection) GetForeignKeys(tableName string) ([]ForeignKey, error)
func (*ClickHouseConnection) GetForeignKeysReferencingTable ¶
func (c *ClickHouseConnection) GetForeignKeysReferencingTable(tableName string) ([]ForeignKey, error)
func (*ClickHouseConnection) GetInfoSQL ¶
func (c *ClickHouseConnection) GetInfoSQL(infoType string) string
func (*ClickHouseConnection) GetPlaceholder ¶
func (c *ClickHouseConnection) GetPlaceholder(paramIndex int) string
func (*ClickHouseConnection) GetTableMetadata ¶
func (c *ClickHouseConnection) GetTableMetadata(tableName string) (*TableMetadata, error)
func (*ClickHouseConnection) GetTables ¶
func (c *ClickHouseConnection) GetTables() ([]string, error)
func (*ClickHouseConnection) GetUniqueConstraints ¶
func (c *ClickHouseConnection) GetUniqueConstraints(tableName string) ([]string, error)
func (*ClickHouseConnection) GetViews ¶
func (c *ClickHouseConnection) GetViews() ([]string, error)
func (*ClickHouseConnection) Open ¶
func (c *ClickHouseConnection) Open() error
func (*ClickHouseConnection) Ping ¶
func (c *ClickHouseConnection) Ping() error
type Connection ¶
type Connection struct {
Name string
DBType string
ConnString string
Username string
Password string
DB *sql.DB
Queries map[string]Query
}
func NewConnection ¶
func NewConnection(name, dbType, connStr, user, pass string) *Connection
func (*Connection) Close ¶
func (c *Connection) Close() error
func (*Connection) Open ¶
func (c *Connection) Open() error
type DatabaseConnection ¶
type DatabaseConnection interface {
Open() error
Ping() error
Close() error
Query(queryName string, args ...any) (any, error)
ExecQuery(sql string, args ...any) (*sql.Rows, error)
Exec(sql string, args ...any) error
GetInfoSQL(infoType string) string
GetTables() ([]string, error)
GetViews() ([]string, error)
GetTableMetadata(tableName string) (*TableMetadata, error)
GetForeignKeys(tableName string) ([]ForeignKey, error)
GetForeignKeysReferencingTable(tableName string) ([]ForeignKey, error)
GetUniqueConstraints(tableName string) ([]string, error)
BuildUpdateStatement(
tableName, columnName, currentValue, pkColumn, pkValue string,
) string
BuildDeleteStatement(tableName, primaryKeyCol, pkValue string) string
ApplyRowLimit(sql string, limit int) string
GetPlaceholder(paramIndex int) string
GetName() string
GetDbType() string
GetConnString() string
GetSchema() string
GetQueries() map[string]Query
GetLastQuery() Query
SetSchema(string)
SetLastQuery(Query)
SetQueries(map[string]Query)
}
func CreateConnection ¶
func CreateConnection(name, dbType, connString string) (DatabaseConnection, error)
type FirebirdConnection ¶
type FirebirdConnection struct {
*BaseConnection
// contains filtered or unexported fields
}
func NewFirebirdConnection ¶
func NewFirebirdConnection(name, connStr string) (*FirebirdConnection, error)
func (*FirebirdConnection) ApplyRowLimit ¶
func (f *FirebirdConnection) ApplyRowLimit(sqlStr string, limit int) string
func (*FirebirdConnection) BuildDeleteStatement ¶
func (f *FirebirdConnection) BuildDeleteStatement(tableName, primaryKeyCol, pkValue string) string
func (*FirebirdConnection) Close ¶
func (f *FirebirdConnection) Close() error
func (*FirebirdConnection) Exec ¶
func (f *FirebirdConnection) Exec(sqlStr string, args ...any) error
func (*FirebirdConnection) GetForeignKeys ¶
func (f *FirebirdConnection) GetForeignKeys(tableName string) ([]ForeignKey, error)
func (*FirebirdConnection) GetForeignKeysReferencingTable ¶
func (f *FirebirdConnection) GetForeignKeysReferencingTable(tableName string) ([]ForeignKey, error)
func (*FirebirdConnection) GetInfoSQL ¶
func (f *FirebirdConnection) GetInfoSQL(infoType string) string
func (*FirebirdConnection) GetPlaceholder ¶
func (f *FirebirdConnection) GetPlaceholder(paramIndex int) string
func (*FirebirdConnection) GetTableMetadata ¶
func (f *FirebirdConnection) GetTableMetadata(tableName string) (*TableMetadata, error)
func (*FirebirdConnection) GetTables ¶
func (f *FirebirdConnection) GetTables() ([]string, error)
func (*FirebirdConnection) GetUniqueConstraints ¶
func (f *FirebirdConnection) GetUniqueConstraints(tableName string) ([]string, error)
func (*FirebirdConnection) GetViews ¶
func (f *FirebirdConnection) GetViews() ([]string, error)
func (*FirebirdConnection) Open ¶
func (f *FirebirdConnection) Open() error
func (*FirebirdConnection) Ping ¶
func (f *FirebirdConnection) Ping() error
func (*FirebirdConnection) Query ¶
func (f *FirebirdConnection) Query(queryName string, args ...any) (any, error)
func (*FirebirdConnection) SetSchema ¶
func (f *FirebirdConnection) SetSchema(schema string)
type ForeignKey ¶
type MySQLConnection ¶
type MySQLConnection struct {
*BaseConnection
// contains filtered or unexported fields
}
func NewMySQLConnection ¶
func NewMySQLConnection(name, connStr string) (*MySQLConnection, error)
func (*MySQLConnection) BuildDeleteStatement ¶
func (m *MySQLConnection) BuildDeleteStatement( tableName, primaryKeyCol, pkValue string, ) string
func (*MySQLConnection) BuildUpdateStatement ¶
func (m *MySQLConnection) BuildUpdateStatement( tableName, columnName, currentValue, pkColumn, pkValue string, ) string
func (*MySQLConnection) Close ¶
func (m *MySQLConnection) Close() error
func (*MySQLConnection) GetForeignKeys ¶
func (m *MySQLConnection) GetForeignKeys(tableName string) ([]ForeignKey, error)
func (*MySQLConnection) GetForeignKeysReferencingTable ¶
func (m *MySQLConnection) GetForeignKeysReferencingTable(tableName string) ([]ForeignKey, error)
func (*MySQLConnection) GetInfoSQL ¶
func (m *MySQLConnection) GetInfoSQL(infoType string) string
func (*MySQLConnection) GetPlaceholder ¶
func (m *MySQLConnection) GetPlaceholder(paramIndex int) string
func (*MySQLConnection) GetTableMetadata ¶
func (m *MySQLConnection) GetTableMetadata( tableName string, ) (*TableMetadata, error)
func (*MySQLConnection) GetTables ¶
func (m *MySQLConnection) GetTables() ([]string, error)
func (*MySQLConnection) GetUniqueConstraints ¶
func (m *MySQLConnection) GetUniqueConstraints(tableName string) ([]string, error)
func (*MySQLConnection) GetViews ¶
func (m *MySQLConnection) GetViews() ([]string, error)
func (*MySQLConnection) Open ¶
func (m *MySQLConnection) Open() error
func (*MySQLConnection) Ping ¶
func (m *MySQLConnection) Ping() error
type OracleConnection ¶
type OracleConnection struct {
*BaseConnection
// contains filtered or unexported fields
}
func NewOracleConnection ¶
func NewOracleConnection(name, connStr string) (*OracleConnection, error)
func (*OracleConnection) ApplyRowLimit ¶
func (oc *OracleConnection) ApplyRowLimit(sql string, limit int) string
func (*OracleConnection) BuildDeleteStatement ¶
func (oc *OracleConnection) BuildDeleteStatement(tableName, primaryKeyCol, pkValue string) string
func (*OracleConnection) BuildUpdateStatement ¶
func (oc *OracleConnection) BuildUpdateStatement(tableName, columnName, currentValue, pkColumn, pkValue string) string
func (*OracleConnection) Close ¶
func (oc *OracleConnection) Close() error
func (*OracleConnection) GetForeignKeys ¶
func (oc *OracleConnection) GetForeignKeys(tableName string) ([]ForeignKey, error)
func (*OracleConnection) GetForeignKeysReferencingTable ¶
func (oc *OracleConnection) GetForeignKeysReferencingTable(tableName string) ([]ForeignKey, error)
func (*OracleConnection) GetInfoSQL ¶
func (oc *OracleConnection) GetInfoSQL(infoType string) string
func (*OracleConnection) GetPlaceholder ¶
func (oc *OracleConnection) GetPlaceholder(paramIndex int) string
func (*OracleConnection) GetTableMetadata ¶
func (oc *OracleConnection) GetTableMetadata(tableName string) (*TableMetadata, error)
func (*OracleConnection) GetTables ¶
func (oc *OracleConnection) GetTables() ([]string, error)
func (*OracleConnection) GetUniqueConstraints ¶
func (oc *OracleConnection) GetUniqueConstraints(tableName string) ([]string, error)
func (*OracleConnection) GetViews ¶
func (oc *OracleConnection) GetViews() ([]string, error)
func (*OracleConnection) Open ¶
func (oc *OracleConnection) Open() error
func (*OracleConnection) Ping ¶
func (oc *OracleConnection) Ping() error
type PostgresConnection ¶
type PostgresConnection struct {
*BaseConnection
// contains filtered or unexported fields
}
func NewPostgresConnection ¶
func NewPostgresConnection(name, connStr string) (*PostgresConnection, error)
func (*PostgresConnection) BuildDeleteStatement ¶
func (c *PostgresConnection) BuildDeleteStatement( tableName, primaryKeyCol, pkValue string, ) string
func (*PostgresConnection) BuildUpdateStatement ¶
func (p *PostgresConnection) BuildUpdateStatement( tableName, columnName, currentValue, pkColumn, pkValue string, ) string
func (*PostgresConnection) Close ¶
func (p *PostgresConnection) Close() error
func (*PostgresConnection) GetForeignKeys ¶
func (p *PostgresConnection) GetForeignKeys(tableName string) ([]ForeignKey, error)
func (*PostgresConnection) GetForeignKeysReferencingTable ¶
func (p *PostgresConnection) GetForeignKeysReferencingTable(tableName string) ([]ForeignKey, error)
func (*PostgresConnection) GetInfoSQL ¶
func (p *PostgresConnection) GetInfoSQL(infoType string) string
func (*PostgresConnection) GetPlaceholder ¶
func (p *PostgresConnection) GetPlaceholder(paramIndex int) string
func (*PostgresConnection) GetTableMetadata ¶
func (p *PostgresConnection) GetTableMetadata( tableName string, ) (*TableMetadata, error)
func (*PostgresConnection) GetTables ¶
func (p *PostgresConnection) GetTables() ([]string, error)
func (*PostgresConnection) GetUniqueConstraints ¶
func (p *PostgresConnection) GetUniqueConstraints(tableName string) ([]string, error)
func (*PostgresConnection) GetViews ¶
func (p *PostgresConnection) GetViews() ([]string, error)
func (*PostgresConnection) Open ¶
func (p *PostgresConnection) Open() error
func (*PostgresConnection) Ping ¶
func (oc *PostgresConnection) Ping() error
type Query ¶
type SQLServerConnection ¶
type SQLServerConnection struct {
*BaseConnection
// contains filtered or unexported fields
}
func NewSQLServerConnection ¶
func NewSQLServerConnection(name, connStr string) (*SQLServerConnection, error)
func (*SQLServerConnection) ApplyRowLimit ¶
func (s *SQLServerConnection) ApplyRowLimit(sql string, limit int) string
func (*SQLServerConnection) BuildDeleteStatement ¶
func (s *SQLServerConnection) BuildDeleteStatement(tableName, primaryKeyCol, pkValue string) string
func (*SQLServerConnection) BuildUpdateStatement ¶
func (s *SQLServerConnection) BuildUpdateStatement(tableName, columnName, currentValue, pkColumn, pkValue string) string
func (*SQLServerConnection) Close ¶
func (s *SQLServerConnection) Close() error
func (*SQLServerConnection) Exec ¶
func (s *SQLServerConnection) Exec(sql string, args ...any) error
func (*SQLServerConnection) GetForeignKeys ¶
func (s *SQLServerConnection) GetForeignKeys(tableName string) ([]ForeignKey, error)
func (*SQLServerConnection) GetForeignKeysReferencingTable ¶
func (s *SQLServerConnection) GetForeignKeysReferencingTable(tableName string) ([]ForeignKey, error)
func (*SQLServerConnection) GetInfoSQL ¶
func (s *SQLServerConnection) GetInfoSQL(infoType string) string
func (*SQLServerConnection) GetPlaceholder ¶
func (s *SQLServerConnection) GetPlaceholder(paramIndex int) string
func (*SQLServerConnection) GetTableMetadata ¶
func (s *SQLServerConnection) GetTableMetadata(tableName string) (*TableMetadata, error)
func (*SQLServerConnection) GetTables ¶
func (s *SQLServerConnection) GetTables() ([]string, error)
func (*SQLServerConnection) GetUniqueConstraints ¶
func (s *SQLServerConnection) GetUniqueConstraints(tableName string) ([]string, error)
func (*SQLServerConnection) GetViews ¶
func (s *SQLServerConnection) GetViews() ([]string, error)
func (*SQLServerConnection) Open ¶
func (s *SQLServerConnection) Open() error
func (*SQLServerConnection) Ping ¶
func (s *SQLServerConnection) Ping() error
type SQLiteConnection ¶
type SQLiteConnection struct {
*BaseConnection
// contains filtered or unexported fields
}
func NewSQLiteConnection ¶
func NewSQLiteConnection(name, connStr string) (*SQLiteConnection, error)
func (*SQLiteConnection) BuildDeleteStatement ¶
func (s *SQLiteConnection) BuildDeleteStatement( tableName, primaryKeyCol, pkValue string, ) string
func (*SQLiteConnection) BuildUpdateStatement ¶
func (s *SQLiteConnection) BuildUpdateStatement( tableName, columnName, currentValue, pkColumn, pkValue string, ) string
func (*SQLiteConnection) Close ¶
func (s *SQLiteConnection) Close() error
func (*SQLiteConnection) GetForeignKeys ¶
func (s *SQLiteConnection) GetForeignKeys(tableName string) ([]ForeignKey, error)
func (*SQLiteConnection) GetForeignKeysReferencingTable ¶
func (s *SQLiteConnection) GetForeignKeysReferencingTable(tableName string) ([]ForeignKey, error)
func (*SQLiteConnection) GetInfoSQL ¶
func (s *SQLiteConnection) GetInfoSQL(infoType string) string
func (*SQLiteConnection) GetPlaceholder ¶
func (s *SQLiteConnection) GetPlaceholder(paramIndex int) string
func (*SQLiteConnection) GetTableMetadata ¶
func (s *SQLiteConnection) GetTableMetadata( tableName string, ) (*TableMetadata, error)
func (*SQLiteConnection) GetTables ¶
func (s *SQLiteConnection) GetTables() ([]string, error)
func (*SQLiteConnection) GetUniqueConstraints ¶
func (s *SQLiteConnection) GetUniqueConstraints(tableName string) ([]string, error)
func (*SQLiteConnection) GetViews ¶
func (s *SQLiteConnection) GetViews() ([]string, error)
func (*SQLiteConnection) Open ¶
func (s *SQLiteConnection) Open() error
func (*SQLiteConnection) Ping ¶
func (s *SQLiteConnection) Ping() error
type TableMetadata ¶
type TableMetadata struct {
TableName string
PrimaryKeys []string
ColumnTypes []string
Columns []string
ForeignKeys []ForeignKey
UniqueConstraints []string
}
func InferTableMetadata ¶
func InferTableMetadata(conn DatabaseConnection, query Query) (*TableMetadata, error)
InferTableMetadata attempts to infer table metadata from a query
Source Files
¶
Click to show internal directories.
Click to hide internal directories.