Documentation
¶
Index ¶
- type ColumnInfo
- type Config
- type Connector
- type DBType
- type DuckDBConnector
- func (d *DuckDBConnector) Close() error
- func (d *DuckDBConnector) Connect() error
- func (d *DuckDBConnector) CreateTable(tableName string, columns []ColumnInfo) error
- func (d *DuckDBConnector) GetTableSchema(tableName string) ([]ColumnInfo, error)
- func (d *DuckDBConnector) InsertRow(tableName string, columns []string, values []any) error
- func (d *DuckDBConnector) ListTables() ([]string, error)
- func (d *DuckDBConnector) Query(query string) (*sql.Rows, error)
- func (d *DuckDBConnector) ReadTable(tableName string, limit int) (*sql.Rows, error)
- type DynamoDBConfig
- type DynamoDBConnector
- func (d *DynamoDBConnector) Close() error
- func (d *DynamoDBConnector) Connect() error
- func (d *DynamoDBConnector) CreateTable(tableName string, columns []ColumnInfo) error
- func (d *DynamoDBConnector) GetTableSchema(tableName string) ([]ColumnInfo, error)
- func (d *DynamoDBConnector) InsertRow(tableName string, columns []string, values []any) error
- func (d *DynamoDBConnector) ListTables() ([]string, error)
- func (d *DynamoDBConnector) Query(query string) (*sql.Rows, error)
- func (d *DynamoDBConnector) ReadItems(tableName string, limit int) ([]map[string]interface{}, error)
- func (d *DynamoDBConnector) ReadTable(tableName string, limit int) (*sql.Rows, error)
- type MongoDBConnector
- func (m *MongoDBConnector) Close() error
- func (m *MongoDBConnector) Connect() error
- func (m *MongoDBConnector) CreateTable(tableName string, columns []ColumnInfo) error
- func (m *MongoDBConnector) GetTableSchema(tableName string) ([]ColumnInfo, error)
- func (m *MongoDBConnector) InsertRow(tableName string, columns []string, values []any) error
- func (m *MongoDBConnector) ListTables() ([]string, error)
- func (m *MongoDBConnector) Query(query string) (*sql.Rows, error)
- func (m *MongoDBConnector) ReadCollection(tableName string, limit int) ([]map[string]interface{}, error)
- func (m *MongoDBConnector) ReadTable(tableName string, limit int) (*sql.Rows, error)
- func (m *MongoDBConnector) SetCollection(collection string)
- type MySQLConnector
- func (m *MySQLConnector) Close() error
- func (m *MySQLConnector) Connect() error
- func (m *MySQLConnector) CreateTable(tableName string, columns []ColumnInfo) error
- func (m *MySQLConnector) GetTableSchema(tableName string) ([]ColumnInfo, error)
- func (m *MySQLConnector) InsertRow(tableName string, columns []string, values []any) error
- func (m *MySQLConnector) ListTables() ([]string, error)
- func (m *MySQLConnector) Query(query string) (*sql.Rows, error)
- func (m *MySQLConnector) ReadTable(tableName string, limit int) (*sql.Rows, error)
- type PostgresConnector
- func (p *PostgresConnector) Close() error
- func (p *PostgresConnector) Connect() error
- func (p *PostgresConnector) CreateTable(tableName string, columns []ColumnInfo) error
- func (p *PostgresConnector) GetTableSchema(tableName string) ([]ColumnInfo, error)
- func (p *PostgresConnector) InsertRow(tableName string, columns []string, values []any) error
- func (p *PostgresConnector) ListTables() ([]string, error)
- func (p *PostgresConnector) Query(query string) (*sql.Rows, error)
- func (p *PostgresConnector) ReadTable(tableName string, limit int) (*sql.Rows, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnInfo ¶
ColumnInfo represents column metadata
type Config ¶
type Config struct {
Type DBType
Host string
Port int
User string
Password string
Database string
SSLMode string
}
Config holds database connection configuration
type Connector ¶
type Connector interface {
Connect() error
Close() error
ListTables() ([]string, error)
GetTableSchema(tableName string) ([]ColumnInfo, error)
ReadTable(tableName string, limit int) (*sql.Rows, error)
Query(query string) (*sql.Rows, error)
CreateTable(tableName string, columns []ColumnInfo) error
InsertRow(tableName string, columns []string, values []any) error
}
Connector interface for database operations
func NewConnector ¶
NewConnector creates a new database connector based on the type
type DuckDBConnector ¶
type DuckDBConnector struct {
// contains filtered or unexported fields
}
DuckDBConnector implements the Connector interface for DuckDB
func NewDuckDBConnector ¶
func NewDuckDBConnector(config Config) (*DuckDBConnector, error)
NewDuckDBConnector creates a new DuckDB connector
func (*DuckDBConnector) Close ¶
func (d *DuckDBConnector) Close() error
Close closes the database connection
func (*DuckDBConnector) Connect ¶
func (d *DuckDBConnector) Connect() error
Connect establishes a connection to DuckDB
func (*DuckDBConnector) CreateTable ¶
func (d *DuckDBConnector) CreateTable(tableName string, columns []ColumnInfo) error
CreateTable creates a new table
func (*DuckDBConnector) GetTableSchema ¶
func (d *DuckDBConnector) GetTableSchema(tableName string) ([]ColumnInfo, error)
GetTableSchema returns the schema for a table
func (*DuckDBConnector) InsertRow ¶
func (d *DuckDBConnector) InsertRow(tableName string, columns []string, values []any) error
InsertRow inserts a row into a table
func (*DuckDBConnector) ListTables ¶
func (d *DuckDBConnector) ListTables() ([]string, error)
ListTables lists all tables in the database
type DynamoDBConfig ¶ added in v1.0.0
type DynamoDBConfig struct {
Region string
TableName string
Endpoint string // Optional: for LocalStack or local DynamoDB
}
DynamoDBConfig holds DynamoDB-specific configuration
type DynamoDBConnector ¶ added in v1.0.0
type DynamoDBConnector struct {
// contains filtered or unexported fields
}
DynamoDBConnector implements the Connector interface for DynamoDB
func NewDynamoDBConnector ¶ added in v1.0.0
func NewDynamoDBConnector(cfg DynamoDBConfig) (*DynamoDBConnector, error)
NewDynamoDBConnector creates a new DynamoDB connector
func (*DynamoDBConnector) Close ¶ added in v1.0.0
func (d *DynamoDBConnector) Close() error
Close closes the DynamoDB connection
func (*DynamoDBConnector) Connect ¶ added in v1.0.0
func (d *DynamoDBConnector) Connect() error
Connect establishes a connection to DynamoDB
func (*DynamoDBConnector) CreateTable ¶ added in v1.0.0
func (d *DynamoDBConnector) CreateTable(tableName string, columns []ColumnInfo) error
CreateTable creates a DynamoDB table
func (*DynamoDBConnector) GetTableSchema ¶ added in v1.0.0
func (d *DynamoDBConnector) GetTableSchema(tableName string) ([]ColumnInfo, error)
GetTableSchema returns the schema for a DynamoDB table (inferred from first item)
func (*DynamoDBConnector) InsertRow ¶ added in v1.0.0
func (d *DynamoDBConnector) InsertRow(tableName string, columns []string, values []any) error
InsertRow inserts an item into a DynamoDB table
func (*DynamoDBConnector) ListTables ¶ added in v1.0.0
func (d *DynamoDBConnector) ListTables() ([]string, error)
ListTables lists all tables in DynamoDB
func (*DynamoDBConnector) Query ¶ added in v1.0.0
func (d *DynamoDBConnector) Query(query string) (*sql.Rows, error)
Query executes a query (not directly supported in DynamoDB for arbitrary SQL)
type MongoDBConnector ¶
type MongoDBConnector struct {
// contains filtered or unexported fields
}
MongoDBConnector implements the Connector interface for MongoDB
func NewMongoDBConnector ¶
func NewMongoDBConnector(config Config) (*MongoDBConnector, error)
NewMongoDBConnector creates a new MongoDB connector
func (*MongoDBConnector) Close ¶
func (m *MongoDBConnector) Close() error
Close closes the MongoDB connection
func (*MongoDBConnector) Connect ¶
func (m *MongoDBConnector) Connect() error
Connect establishes a connection to MongoDB
func (*MongoDBConnector) CreateTable ¶
func (m *MongoDBConnector) CreateTable(tableName string, columns []ColumnInfo) error
CreateTable creates a collection (MongoDB creates collections automatically)
func (*MongoDBConnector) GetTableSchema ¶
func (m *MongoDBConnector) GetTableSchema(tableName string) ([]ColumnInfo, error)
GetTableSchema returns the schema for a collection (inferred from first document)
func (*MongoDBConnector) InsertRow ¶
func (m *MongoDBConnector) InsertRow(tableName string, columns []string, values []any) error
InsertRow inserts a document into a collection
func (*MongoDBConnector) ListTables ¶
func (m *MongoDBConnector) ListTables() ([]string, error)
ListTables lists all collections in the database
func (*MongoDBConnector) Query ¶
func (m *MongoDBConnector) Query(query string) (*sql.Rows, error)
Query executes a query (not directly supported in MongoDB)
func (*MongoDBConnector) ReadCollection ¶
func (m *MongoDBConnector) ReadCollection(tableName string, limit int) ([]map[string]interface{}, error)
ReadCollection reads documents from a MongoDB collection and returns them as maps
func (*MongoDBConnector) SetCollection ¶
func (m *MongoDBConnector) SetCollection(collection string)
SetCollection sets the collection to work with
type MySQLConnector ¶
type MySQLConnector struct {
// contains filtered or unexported fields
}
MySQLConnector implements the Connector interface for MySQL
func NewMySQLConnector ¶
func NewMySQLConnector(config Config) (*MySQLConnector, error)
NewMySQLConnector creates a new MySQL connector
func (*MySQLConnector) Close ¶
func (m *MySQLConnector) Close() error
Close closes the database connection
func (*MySQLConnector) Connect ¶
func (m *MySQLConnector) Connect() error
Connect establishes a connection to the MySQL database
func (*MySQLConnector) CreateTable ¶
func (m *MySQLConnector) CreateTable(tableName string, columns []ColumnInfo) error
CreateTable creates a new table
func (*MySQLConnector) GetTableSchema ¶
func (m *MySQLConnector) GetTableSchema(tableName string) ([]ColumnInfo, error)
GetTableSchema returns the schema for a table
func (*MySQLConnector) InsertRow ¶
func (m *MySQLConnector) InsertRow(tableName string, columns []string, values []any) error
InsertRow inserts a row into a table
func (*MySQLConnector) ListTables ¶
func (m *MySQLConnector) ListTables() ([]string, error)
ListTables lists all tables in the database
type PostgresConnector ¶
type PostgresConnector struct {
// contains filtered or unexported fields
}
PostgresConnector implements the Connector interface for PostgreSQL
func NewPostgresConnector ¶
func NewPostgresConnector(config Config) (*PostgresConnector, error)
NewPostgresConnector creates a new PostgreSQL connector
func (*PostgresConnector) Close ¶
func (p *PostgresConnector) Close() error
Close closes the database connection
func (*PostgresConnector) Connect ¶
func (p *PostgresConnector) Connect() error
Connect establishes a connection to the PostgreSQL database
func (*PostgresConnector) CreateTable ¶
func (p *PostgresConnector) CreateTable(tableName string, columns []ColumnInfo) error
CreateTable creates a new table
func (*PostgresConnector) GetTableSchema ¶
func (p *PostgresConnector) GetTableSchema(tableName string) ([]ColumnInfo, error)
GetTableSchema returns the schema for a table
func (*PostgresConnector) InsertRow ¶
func (p *PostgresConnector) InsertRow(tableName string, columns []string, values []any) error
InsertRow inserts a row into a table
func (*PostgresConnector) ListTables ¶
func (p *PostgresConnector) ListTables() ([]string, error)
ListTables lists all tables in the database