class
Prostore::TUI::Browser
- Prostore::TUI::Browser
- Reference
- Object
Defined in:
prostore/tui/browser.crConstructors
Instance Method Summary
- #count(table : String, filter : Filter | Nil = nil) : Int64
- #delete_row(table : String, pk_col : String, pk_val : String) : Nil
-
#enum_columns(table : String) : Hash(String, EnumColumn)
Returns enum metadata keyed by column name, for columns whose portable type is
enum_stringorenum_int. -
#fetch_row(table : String, pk_col : String, pk_val : String) : Hash(String, RowVal) | Nil
Fetch a single row by its primary key value.
-
#fetch_rows(table : String, limit : Int32, offset : Int32, filter : Filter | Nil = nil) : Tuple(Array(String), Array(Row))
Returns column names and rows.
-
#insert_row(table : String, data : Hash(String, String | Nil)) : Nil
datavalues may be nil to bind explicit NULL. -
#pk_col(table : String) : String | Nil
Returns the primary key column name, or nil if none found.
-
#portable_types(table : String) : Hash(String, String)
Returns prostore portable type tags keyed by column name, read from the prostore_schema bookkeeping table.
- #schema(table : String) : Adapter::LiveTable
- #tables : Array(String)
- #update_cell(table : String, pk_col : String, pk_val : String, column : String, value : String | Nil) : Nil
Constructor Detail
Instance Method Detail
Returns enum metadata keyed by column name, for columns whose portable
type is enum_string or enum_int. Columns without enum metadata are
omitted. Returns an empty hash if the bookkeeping table doesn't exist
(database not managed by prostore). Reuses the typed SchemaTable
reader so the JSON-decoded enum_members array is honoured exactly
as written by the migration runner.
Fetch a single row by its primary key value.
Returns column names and rows. Values are String or nil.
data values may be nil to bind explicit NULL. Columns the caller
wants the database default for should simply be omitted from data.
Returns the primary key column name, or nil if none found.
Returns prostore portable type tags keyed by column name, read from the prostore_schema bookkeeping table. Returns an empty hash if the table doesn't exist (database not managed by prostore — caller should fall back to SQL type_text inference).