Documentation ¶
Index ¶
- func Contains(a []map[string]string, x string) bool
- type CampaignFieldList
- type ColumnMeta
- type DBConnection
- func (con *DBConnection) AddColumnsMySQL(tableName string, columnMaps []map[string]string, b *bytes.Buffer)
- func (con *DBConnection) AddColumnsPostgres(tableName string, columnMaps []map[string]string, b *bytes.Buffer)
- func (con *DBConnection) AddColumnsSQLServer(tableName string, columnMaps []map[string]string, b *bytes.Buffer)
- func (con *DBConnection) ChangeColumnsMySQL(tableName string, columns map[string]string, b *bytes.Buffer)
- func (con *DBConnection) ChangeColumnsPostgres(tableName string, columns map[string]string, b *bytes.Buffer)
- func (con *DBConnection) ChangeColumnsSQLServer(tableName string, columns map[string]string, b *bytes.Buffer)
- func (con *DBConnection) CreateIndexMySQL(tableName string, columns []string, b *bytes.Buffer)
- func (con *DBConnection) CreateIndexPostgres(tableName string, columns []string, b *bytes.Buffer)
- func (con *DBConnection) CreateIndexSQLServer(tableName string, columns []string, b *bytes.Buffer)
- func (con *DBConnection) CreateTableMySQL(tableName string, columnMaps []map[string]string, b *bytes.Buffer)
- func (con *DBConnection) CreateTablePostgres(tableName string, columnMaps []map[string]string, b *bytes.Buffer)
- func (con *DBConnection) CreateTableSQLServer(tableName string, columnMaps []map[string]string, b *bytes.Buffer)
- func (con *DBConnection) DescribeTableColumns(tableName string) map[string]*ColumnMeta
- func (con *DBConnection) DescribeTableColumnsMySQL(tableName string, b *bytes.Buffer)
- func (con *DBConnection) DescribeTableColumnsPostgres(tableName string, b *bytes.Buffer)
- func (con *DBConnection) DescribeTableColumnsSQLServer(tableName string, b *bytes.Buffer)
- func (con *DBConnection) GetContactMD5MySQL(tableName string, ids []string, b *bytes.Buffer)
- func (con *DBConnection) GetContactMD5Postgres(tableName string, ids []string, b *bytes.Buffer)
- func (con *DBConnection) GetContactMD5SQLServer(tableName string, ids []string, b *bytes.Buffer)
- func (con *DBConnection) PrepareUpsertMySQL(tableName string, columns []string, b *bytes.Buffer)
- func (con *DBConnection) PrepareUpsertPostgres(tableName string, columns []string, b *bytes.Buffer)
- func (con *DBConnection) PrepareUpsertSQLServer(tableName string, columns []string, b *bytes.Buffer)
- func (con *DBConnection) PrepareUpsertStatement(tableName string, data []string) (*sql.Stmt, error)
- func (con *DBConnection) QueryMD5(ids []string) map[string]string
- func (con *DBConnection) RefreshTableMetadata(entityType string)
- func (con *DBConnection) UpdateTables(fieldList CampaignFieldList) error
- func (con *DBConnection) Upsert(entity Entity) error
- type Entity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CampaignFieldList ¶
type ColumnMeta ¶
type DBConnection ¶
type DBConnection struct { DB *sql.DB DBType string TablePrefix string TableMeta map[string]map[string]*ColumnMeta // table | column | metadata of column }
func Open ¶
func Open(dbType string, uri string, tablePrefix string, l *logging.Logger) (*DBConnection, error)
URIs: MYSQL: user:password@/{TABLE_PREFIX}ml_camp?charset=utf8mb4&collation=utf8mb4_bin POSTGRES: postgres://user:password@localhost:5432/{TABLE_PREFIX}ml_camp MSSQL: sqlserver://user:password@localhost:1433?database={TABLE_PREFIX}ml_camp
func (*DBConnection) AddColumnsMySQL ¶
func (*DBConnection) AddColumnsPostgres ¶
func (*DBConnection) AddColumnsSQLServer ¶
func (*DBConnection) ChangeColumnsMySQL ¶
func (*DBConnection) ChangeColumnsPostgres ¶
func (*DBConnection) ChangeColumnsSQLServer ¶
func (*DBConnection) CreateIndexMySQL ¶
func (con *DBConnection) CreateIndexMySQL(tableName string, columns []string, b *bytes.Buffer)
func (*DBConnection) CreateIndexPostgres ¶
func (con *DBConnection) CreateIndexPostgres(tableName string, columns []string, b *bytes.Buffer)
func (*DBConnection) CreateIndexSQLServer ¶
func (con *DBConnection) CreateIndexSQLServer(tableName string, columns []string, b *bytes.Buffer)
func (*DBConnection) CreateTableMySQL ¶
func (*DBConnection) CreateTablePostgres ¶
func (*DBConnection) CreateTableSQLServer ¶
func (*DBConnection) DescribeTableColumns ¶
func (con *DBConnection) DescribeTableColumns(tableName string) map[string]*ColumnMeta
func (*DBConnection) DescribeTableColumnsMySQL ¶
func (con *DBConnection) DescribeTableColumnsMySQL(tableName string, b *bytes.Buffer)
func (*DBConnection) DescribeTableColumnsPostgres ¶
func (con *DBConnection) DescribeTableColumnsPostgres(tableName string, b *bytes.Buffer)
func (*DBConnection) DescribeTableColumnsSQLServer ¶
func (con *DBConnection) DescribeTableColumnsSQLServer(tableName string, b *bytes.Buffer)
func (*DBConnection) GetContactMD5MySQL ¶
func (con *DBConnection) GetContactMD5MySQL(tableName string, ids []string, b *bytes.Buffer)
func (*DBConnection) GetContactMD5Postgres ¶
func (con *DBConnection) GetContactMD5Postgres(tableName string, ids []string, b *bytes.Buffer)
func (*DBConnection) GetContactMD5SQLServer ¶
func (con *DBConnection) GetContactMD5SQLServer(tableName string, ids []string, b *bytes.Buffer)
func (*DBConnection) PrepareUpsertMySQL ¶
func (con *DBConnection) PrepareUpsertMySQL(tableName string, columns []string, b *bytes.Buffer)
func (*DBConnection) PrepareUpsertPostgres ¶
func (con *DBConnection) PrepareUpsertPostgres(tableName string, columns []string, b *bytes.Buffer)
func (*DBConnection) PrepareUpsertSQLServer ¶
func (con *DBConnection) PrepareUpsertSQLServer(tableName string, columns []string, b *bytes.Buffer)
func (*DBConnection) PrepareUpsertStatement ¶
func (*DBConnection) RefreshTableMetadata ¶
func (con *DBConnection) RefreshTableMetadata(entityType string)
func (*DBConnection) UpdateTables ¶
func (con *DBConnection) UpdateTables(fieldList CampaignFieldList) error
func (*DBConnection) Upsert ¶
func (con *DBConnection) Upsert(entity Entity) error
Click to show internal directories.
Click to hide internal directories.