monet v0.0.9 Monet.Result
Represents the result from a query to MonetDB.
For a select columns
are the column names and rows
is a list of lists.
These can be accessed directly. However, the module also implements Enumerable
and Jason.Encode. By default, Enumerationa and Jason.Encode will expose the list
of lists as-is. However, the Result can be configured to return a list of maps
(optionally with atom keys). See Monet.as_map/1
and Monet.as_map/2
for
more information.
last_id
is non-nil in the case of an insert to a table with an auto incremental
column (e.g. serial) and nil in all other cases.
row_count
represents either the number of affected rows (for an update or
delete) or the number of rows
(for a select).
Responses from the MonetDB server generally include some meta data, such as
timing information. This data isn't useful to this driver, but it's exposed in
in the meta
field, in case it's useful to the caller. This data is unparsed;
it's binary field.
Link to this section Summary
Functions
Switches the the mode of the result to enumerate or jason encode maps. See
Monet.as_map/1
and Monet.as_map/2
for more information.
Creates a new Result with only a meta field (the type of result you'd get from a create table, for example)
Creates a new Result from a select or other queries that return data
Creates a new Result with a count and last_id, used by update/delete/insert
Link to this section Functions
as_map(result, opts)
Switches the the mode of the result to enumerate or jason encode maps. See
Monet.as_map/1
and Monet.as_map/2
for more information.
meta(meta)
Creates a new Result with only a meta field (the type of result you'd get from a create table, for example)
new(header, columns, rows, count)
Creates a new Result from a select or other queries that return data
upsert(meta, count, last_id)
Creates a new Result with a count and last_id, used by update/delete/insert