PostgresTypedSqlType class abstract interface Getting Started

A SqlType that knows its native Postgres type name.

PostgresDialect.castType consults this first, so any custom codec that implements it becomes usable where basalt must cast bound parameters — the VALUES table of a batch updateAll, whose parameter types Postgres cannot otherwise infer:

final class PointSqlType extends SqlType<Point>
    implements PostgresTypedSqlType {
  @override
  String? get postgresType => 'point';
  // encode/decode ...
}

The four native codecs shipped by this package (PostgresJsonbSqlType, PostgresUuidSqlType, PostgresNumericSqlType, PostgresArraySqlType) implement it; the core types (IntSqlType, StringSqlType, ...) are mapped directly by the dialect.

Implementers

Properties

hashCode → int
The hash code for this object.
no setterinherited
postgresType → String?
The native type name to CAST to, or null when no cast is available (the value then only works where Postgres can infer its type).
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited