Documentation
¶
Index ¶
Constants ¶
const ( FilterUnsupported = dio.FilterUnsupported FilterExact = dio.FilterExact )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func (*Connection) Conn ¶
func (c *Connection) Conn() *pgx.Conn
Conn returns the underlying pgx connection.
type ConnectionConfig ¶
type ConnectionConfig struct {
Name string
User string
Host string
Port string
SSLMode string
ConnectionTimeout int
Password string
SSLCertPath string
SSLKeyPath string
SSLRootCertPath string
PoolMinConnections string
PoolMaxConnections string
PoolMaxConnLife time.Duration
PoolMaxConnIdle time.Duration
PoolHealthCheck time.Duration
}
ConnectionConfig represents a configuration for a connection to a Postgres database.
func StartTestDB ¶
func StartTestDB(t *testing.T) ConnectionConfig
func (ConnectionConfig) ConnectionString ¶
func (c ConnectionConfig) ConnectionString() string
ConnectionString returns a connection string suitable for the pgx Postgres driver.
type FilterSupport ¶
type FilterSupport = dio.FilterSupport
FilterSupport re-exports dio.FilterSupport constants for use within this package.
type Platform ¶
type Platform struct{}
func (*Platform) OpenConnection ¶
func (p *Platform) OpenConnection(ctx context.Context, cfg platform.ConnectionConfig) (platform.Connection, error)
type PostgresContainer ¶
type PostgresContainer struct {
// contains filtered or unexported fields
}
func NewPostgresContainer ¶
func NewPostgresContainer(t *testing.T) *PostgresContainer
func (*PostgresContainer) Close ¶
func (db *PostgresContainer) Close(t *testing.T)
func (*PostgresContainer) ConnectionConfig ¶
func (db *PostgresContainer) ConnectionConfig(t *testing.T) ConnectionConfig
type QueryReader ¶
type QueryReader struct {
// contains filtered or unexported fields
}
QueryReader implements dio.Reader for a postgres query result. Query execution is deferred until Read() is called, allowing filters to be pushed down as SQL WHERE clauses.
func (*QueryReader) ClassifyFilters ¶
func (q *QueryReader) ClassifyFilters(filters []dio.Filter) []FilterSupport
ClassifyFilters reports that all supported filter types are evaluated exactly by postgres (WHERE clause pushdown guarantees all returned rows satisfy the filter).
func (*QueryReader) Read ¶
func (q *QueryReader) Read(ctx context.Context, opts ...dio.ReadOption) (dio.BatchStream, error)
Read executes the query and opens a BatchStream over the result rows. If filters are provided via WithFilter, they are pushed down as a SQL WHERE clause. Second call returns an empty stream (read-once semantics matching DB cursor nature).
func (*QueryReader) Schema ¶
func (q *QueryReader) Schema() *arrow.Schema
Schema returns the Arrow schema derived from the query result columns.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer implements dio.Writer by inserting Arrow data into a postgres table via CopyFrom.
func NewWriter ¶
func NewWriter(conn *Connection, opts WriterOpts) *Writer
NewWriter creates a postgres Writer.
func (*Writer) Close ¶
Close is a no-op for the postgres writer (connection lifecycle is managed externally).
func (*Writer) WriteStream ¶
WriteStream writes all records from the stream into the postgres table using CopyFrom.
type WriterOpts ¶
WriterOpts configures a postgres Writer.