Interface SqlArrayParameter<E>

Type Parameters:
E - the Java element type of the array; each element must be bindable to the SQL element type named by getBaseTypeName() by the active PreparedStatementBinder.

@ThreadSafe public interface SqlArrayParameter<E>
Encapsulates PreparedStatement parameter data meant to be bound to a formal java.sql.Array type by PreparedStatementBinder.

The baseTypeName corresponds to the value of java.sql.Array#getBaseTypeName() and is database-specific.

You may determine available baseTypeName values for your database by examining metadata exposed via Database.readDatabaseMetaData(DatabaseMetaDataReader).

Standard instances may be constructed via Parameters.sqlArrayOf(String, Object[]) and Parameters.sqlArrayOf(String, List). A null element container represents SQL NULL, distinct from an empty array. On PostgreSQL the default binder asks the driver to resolve the element's actual array type, preserving typed nulls without column context. Type-name syntax remains driver-specific; for PostgreSQL typed nulls supply the element name, such as "text", rather than constructing an array name such as "text[]".

Elements may themselves be SqlArrayParameters. Pyranid materializes nested arrays recursively, but multidimensional support and type-name syntax remain driver-specific; this shape is integration-verified on DuckDB. Each containing array's baseTypeName must name its element type.

DuckDB elements that represent an instant require an explicit TIMESTAMP or TIMESTAMPTZ base type. A named type alias does not expose its underlying timestamp semantics through this binding path, so binding an instant-bearing value through one fails fast rather than guessing.

Implementations should be threadsafe.

Since:
3.0.0
Author:
Mark Allen