class Athena::ORM::Platforms::Postgres
inherits Athena::ORM::Platforms::Platform
#
Base platform for Postgres.
Database-generated identifiers are read back with INSERT ... RETURNING.
Queries run through an AORM::Connection, such as native queries, may use ? placeholders, which are rewritten to $1, $2, etc. before being sent to the server.
Methods#
#big_int_type_declaration_sql(column : Schema::Column) : String#
Returns the SQL declaring column as a big (8 byte) integer column.
#blob_type_declaration_sql(column : Schema::Column) : String#
Returns the SQL declaring column as a binary large object column.
#boolean_type_declaration_sql(column : Schema::Column) : String#
Returns the SQL declaring column as a boolean column.
#convert_from_boolean(value : String) : Bool#
Converts value, a boolean literal such as "t" or "off", into a Bool.
#date_time_type_declaration_sql(column : Schema::Column) : String#
Returns the SQL declaring column as a date and time column without a time zone.
#empty_identity_insert_sql(quoted_table_name : String, quoted_identifier_column_name) : String#
Returns the SQL that inserts a row into quoted_table_name without values for any column, letting the database generate quoted_identifier_column_name.
#guid_type_declaration_sql(column : Schema::Column) : String#
Returns the SQL declaring column as a UUID column.
Platforms without a native UUID type declare a 36 character fixed-length string column.
Postgres declares a native UUID column.
#integer_type_declaration_sql(column : Schema::Column) : String#
Returns the SQL declaring column as an integer (4 byte) column.
#sequence_next_value_sql(sequence_name : String) : String#
Returns the SQL that fetches the next value of the sequence named sequence_name.
Raises NotImplementedError on platforms without sequences.
#small_int_type_declaration_sql(column : Schema::Column) : String#
Returns the SQL declaring column as a small (2 byte) integer column.
#supports_returning? : Bool#
Returns true if INSERT statements can return values of the inserted row via a RETURNING clause.
Database-generated identifiers are read from that clause when supported, and from the driver's last insert id otherwise. Only the latter is limited to a single identifier column.