Documentation
¶
Index ¶
- type BulkInsertOptions
- type BulkInserter
- type DDLManager
- type DDLRequest
- type Database
- func (d *Database) BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
- func (d *Database) Close() error
- func (d *Database) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (d *Database) HasUserTables(ctx context.Context) (bool, error)
- func (d *Database) Query(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (d *Database) QueryRow(ctx context.Context, query string, args ...interface{}) *sql.Row
- type DatabaseOptions
- type RowData
- type SchemaProgressCallback
- type TableData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BulkInsertOptions ¶
type BulkInsertOptions struct {
// BatchSize determines how many rows to insert per transaction
BatchSize int
// MaxRetries sets the maximum number of retry attempts for failed operations
MaxRetries int
// ArrayWarningThreshold sets the threshold for logging warnings about large arrays
ArrayWarningThreshold int
}
BulkInsertOptions configures bulk insertion behavior
func DefaultBulkInsertOptions ¶
func DefaultBulkInsertOptions() *BulkInsertOptions
DefaultBulkInsertOptions returns sensible defaults for bulk insertion
type BulkInserter ¶
type BulkInserter struct {
// contains filtered or unexported fields
}
BulkInserter handles efficient batch insertion of DAT file data
func NewBulkInserter ¶
func NewBulkInserter(db *Database, options *BulkInsertOptions) *BulkInserter
NewBulkInserter creates a new bulk inserter with the given database and options
func (*BulkInserter) InsertTableData ¶
func (bi *BulkInserter) InsertTableData(ctx context.Context, tableData *TableData) error
InsertTableData performs bulk insertion of table data with transaction batching
type DDLManager ¶
type DDLManager struct {
// contains filtered or unexported fields
}
DDLManager handles schema creation with bulk DDL execution
func NewDDLManager ¶
func NewDDLManager(db *Database) *DDLManager
NewDDLManager creates a new DDL manager
func (*DDLManager) CreateSchemas ¶
func (dm *DDLManager) CreateSchemas(ctx context.Context, tables []dat.TableSchema, progressCallback SchemaProgressCallback) error
CreateSchemas creates all schemas using bulk execution for optimal performance
func (*DDLManager) CreateTableSchema ¶
func (dm *DDLManager) CreateTableSchema(ctx context.Context, table *dat.TableSchema) error
CreateTableSchema creates the complete database schema for a table.
func (*DDLManager) GenerateTableDDL ¶
func (dm *DDLManager) GenerateTableDDL(table *dat.TableSchema) (string, error)
GenerateTableDDL generates CREATE TABLE SQL for a given table schema
type DDLRequest ¶
type DDLRequest struct {
Type string // "table" or "junction"
DDL string
TableName string
Description string
}
DDLRequest represents a request to generate and execute DDL
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database represents a connection to the ExileDB SQLite database
func NewDatabase ¶
func NewDatabase(options *DatabaseOptions) (*Database, error)
NewDatabase creates a new database connection with the given options
func (*Database) HasUserTables ¶
HasUserTables checks if the database contains any user tables (non-system and non-metadata tables)
type DatabaseOptions ¶
type DatabaseOptions struct {
// Path to the SQLite database file
Path string
// WALMode enables Write-Ahead Logging mode for better concurrency
WALMode bool
// ForeignKeys enables foreign key constraint checking
ForeignKeys bool
// BusyTimeout sets the timeout for locked database operations
BusyTimeout time.Duration
}
DatabaseOptions configures database creation and connection behavior
func DefaultDatabaseOptions ¶
func DefaultDatabaseOptions(path string) *DatabaseOptions
DefaultDatabaseOptions returns sensible default options for database connections
type RowData ¶
type RowData struct {
Index int // Row index from DAT file
Values map[string]interface{} // Column name -> value mapping
}
RowData represents a single row of data with column values
type SchemaProgressCallback ¶ added in v1.1.0
SchemaProgressCallback is called during schema creation to report progress