postgres

package
v0.0.0-...-e6c4605 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package postgres provides a PostgreSQL database adapter for LeapSQL.

Package postgres provides a PostgreSQL database adapter for LeapSQL.

This file registers the PostgreSQL adapter with the adapter registry. Import this package with a blank identifier to register the adapter:

import _ "github.com/leapstack-labs/leapsql/pkg/adapters/postgres"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	adapter.BaseSQLAdapter
	// contains filtered or unexported fields
}

Adapter implements the adapter.Adapter interface for PostgreSQL.

func New

func New(logger *slog.Logger) *Adapter

New creates a new PostgreSQL adapter instance. If logger is nil, a discard logger is used.

func (*Adapter) Connect

func (a *Adapter) Connect(ctx context.Context, cfg core.AdapterConfig) error

Connect establishes a connection to PostgreSQL.

func (*Adapter) DialectConfig

func (a *Adapter) DialectConfig() *core.DialectConfig

DialectConfig returns the SQL dialect configuration for this adapter.

func (*Adapter) GetTableMetadata

func (a *Adapter) GetTableMetadata(ctx context.Context, table string) (*core.TableMetadata, error)

GetTableMetadata retrieves metadata for a specified table.

func (*Adapter) LoadCSV

func (a *Adapter) LoadCSV(ctx context.Context, tableName string, filePath string) error

LoadCSV loads data from a CSV file into a table using COPY FROM STDIN. All columns are created as TEXT type for robustness.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL