class DBX::Adapter::PostgreSQL

Overview

PostgreSQL adapter

Defined in:

adapter/pg.cr

Class Method Summary

Instance Method Summary

Instance methods inherited from class DBX::Adapter::Base

create!(query : DBX::Query, data : Hash | NamedTuple, as types, returning : DBX::QueryBuilder::OneOrMoreFieldsType = "*", pk_name : DBX::QueryBuilder::FieldType = :id, pk_type = ::Union(Int64, ::Nil)) create!, db : DB::Database db, new_builder : QueryBuilder new_builder

Constructor methods inherited from class DBX::Adapter::Base

new(db : DB::Database) new

Class methods inherited from class DBX::Adapter::Base

builder_class : QueryBuilder.class builder_class, new_builder : QueryBuilder new_builder

Class Method Detail

def self.builder_class : DBX::QueryBuilder.class #

Returns query builder class adapted for PostgreSQL.


[View source]

Instance Method Detail

def builder_class : DBX::QueryBuilder.class #

Returns query builder class adapted for PostgreSQL.


[View source]
def create!(query : DBX::Query, data : Hash | NamedTuple, as types, returning : DBX::QueryBuilder::OneOrMoreFieldsType = "*", pk_name : DBX::QueryBuilder::FieldType = :id, pk_type = ::Union(Int64, ::Nil)) #

Creates a new record and returns. See DBX::Query#create! for more details.

To get recorded data, PostgreSQL adapter use RETURNING SQL statement. pk_name and pk_type are useless and ignored, thanks PostgreSQL RETURNING that makes it simpler and more efficient :)


[View source]