class Clear::SQL::InsertQuery
- Clear::SQL::InsertQuery
- Reference
- Object
Overview
An insert query
cf. postgres documentation
[ WITH [ RECURSIVE ] with_query [, ...] ]
INSERT INTO table_name [ AS alias ] [ ( column_name [, ...] ) ]
{ DEFAULT VALUES | VALUES ( { expression | DEFAULT } [, ...] ) [, ...] | query }
[ ON CONFLICT [ conflict_target ] conflict_action ]
[ RETURNING * | output_expression [ [ AS ] output_name ] [, ...] ]
Included Modules
- Clear::SQL::Query::Change
- Clear::SQL::Query::Connection
- Clear::SQL::Query::CTE
- Clear::SQL::Query::OnConflict
Defined in:
clear/sql/insert_query.crConstructors
Instance Method Summary
- #clear_values
-
#columns(*args)
Used with values
- #execute(connection_name : String = "default") : Hash(String, Clear::SQL::Any)
- #fetch(connection_name : String = "default", &block : Hash(String, Clear::SQL::Any) -> Nil)
- #into(table : Symbol | String)
- #keys : Array(Symbolic)
- #returning : String?
- #returning(str : String)
-
#size : Int32
Number of rows of this insertion request
- #table : Symbol | String
- #table? : Symbol | String?
- #to_sql
- #values(*args)
- #values : SelectBuilder | Array(Array(Inserable))
-
#values(select_query : SelectBuilder)
Insert into ...
- #values(rows : Array(NamedTuple))
-
#values(row : NamedTuple)
Fast insert system
- #values(rows : Array(Hash(Symbolic, Inserable)))
- #values(row : Hash(Symbolic, Inserable))
Instance methods inherited from module Clear::SQL::Query::OnConflict
clear_conflict
clear_conflict,
conflict?
conflict?,
do_conflict_action(str)
do_conflict_action,
do_nothing
do_nothing,
do_update(&)
do_update,
on_conflict(constraint : String | Bool | OnConflictWhereClause = true)on_conflict(&) on_conflict, on_conflict_action : String | Clear::SQL::UpdateQuery on_conflict_action, on_conflict_condition : String | OnConflictWhereClause | Bool on_conflict_condition
Instance methods inherited from module Clear::SQL::Query::Connection
connection_name : String
connection_name,
use_connection(connection_name : String)
use_connection
Instance methods inherited from module Clear::SQL::Query::Change
change! : self
change!
Instance methods inherited from module Clear::SQL::Query::CTE
cte : Hash(String, Clear::SQL::Query::CTE::Record)
cte,
with_cte(name, request : CTEAuthorized, recursive = false)with_cte(tuple : NamedTuple) with_cte, with_recursive_cte(tuple : NamedTuple) with_recursive_cte