abstract class RethinkORM::Base
- RethinkORM::Base
- ActiveModel::Model
- Reference
- Object
Included Modules
- ActiveModel::Callbacks
- ActiveModel::Validation
- RethinkORM::Associations
- RethinkORM::Index
- RethinkORM::Persistence
- RethinkORM::Queries
- RethinkORM::Table
- RethinkORM::Validators
Direct Known Subclasses
Defined in:
rethinkdb-orm/base.crConstant Summary
-
AM_PARENT_TYPE =
{:type => RethinkORM::Base} of Nil => Nil
-
INDICES =
[] of NamedTuple(field: String, table: String)
-
TABLES =
["locks"] of String
Class Method Summary
-
.all(**options)
Cursor of each model in the database
-
.attributes
You may want a list of available attributes
-
.changes(id : String | Nil = nil, **options)
Changefeed at document (if id passed) or table level
-
.changes(**options, & : RethinkDB::Table -> HasChanges)
Creates a Changefeed on query
-
.clear
Removes all records from the table
-
.collection_query(**options, &)
Unsafe method until
.where
can accept more generic arguments Makes 2 LARGE assumptions - User correctly scopes the query under the right table - User forms a query that returns a collection of models -
.count
Returns a count of all documents in the table
-
.count(**attrs)
Returns a count of all documents in the table
-
.count(**attrs, &predicate : RethinkDB::DatumTerm -> RethinkDB::DatumTerm)
Returns a count of documents for which predicate block is true
-
.create(**attributes)
Creates the model.
-
.create!(**attributes)
Creates the model.
-
.exists?(id : String, **options)
Check for document presence in the table
-
.find(id : String, **options)
Find single document by id
-
.find!(id : String, **options)
Lookup document by id
-
.find_all(ids : Array | Tuple, **options)
Look up document by id
-
.find_by(**attribute)
Returns documents with columns matching the given criteria
-
.find_by(**attribute, &predicate : RethinkDB::DatumTerm -> RethinkDB::DatumTerm)
Returns documents with columns matching the given criteria
-
.get_all(values : Array | Tuple, **options)
Query by ids, optionally set a secondary index
- .has_index?(field)
-
.raw_changes(id : String | Nil = nil, **options)
Establishes a changefeed of models in a RethinkDB table Changefeed at document (id passed) or table level
-
.raw_changes(**options, & : RethinkDB::Table -> HasChanges)
Creates a Changefeed::Raw on query
-
.raw_query(**options, &)
Unsafe method until
.where
can accept more generic arguments Makes 2 LARGE assumptions - User correctly scopes the query under the right table - User forms a query that returns a collection of models -
.table_query(**options, &)
Yield a RethinkDB handle namespaced under the document table
-
.where(&predicate : RethinkDB::DatumTerm -> RethinkDB::DatumTerm)
Returns documents for which predicate block is true
- .where(**attrs, &predicate : RethinkDB::DatumTerm -> RethinkDB::DatumTerm)
- .where(attrs : Hash, **options)
-
.where(**attrs)
Returns documents containing fields that match the attributes
Instance Method Summary
-
#==(other : self)
Returns
true
if this reference is the same as other. -
#apply_defaults
Generate code to apply default values
- #assign_attributes(id : String | Nil | Missing = Missing)
-
#assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String))
Accept HTTP params
-
#attributes
Returns a Hash of all the attribute values
-
#attributes_tuple
Returns a NamedTuple of all attribute values
-
#id_default : String | Nil
Attribute default value
-
#persistent_attributes
Returns a hash of all attributes that may be persisted
-
#uuid_generator=(generator : Class)
Allow user defined uuid generator
Instance methods inherited from module RethinkORM::Persistence
delete
delete,
destroy
destroy,
destroyed
destroyed,
destroyed=(destroyed)
destroyed=,
destroyed?
destroyed?,
new_record?
new_record?,
persisted?
persisted?,
reload!
reload!,
save(**options)
save,
save!(**options)
save!,
update(**attributes)
update,
update!(**attributes)
update!,
update_fields(**attributes)
update_fields
Instance methods inherited from module RethinkORM::Associations
reset_associations
reset_associations
Class Method Detail
Changefeed at document (if id passed) or table level
Yields an infinite iterator of model events
Unsafe method until .where
can accept more generic arguments
Makes 2 LARGE assumptions
- User correctly scopes the query under the right table
- User forms a query that returns a collection of models
Should raise/not compile on malformed query/incorrect return type to create a collection
Returns a count of documents for which predicate block is true
Returns documents with columns matching the given criteria
Query by ids, optionally set a secondary index
Establishes a changefeed of models in a RethinkDB table Changefeed at document (id passed) or table level
Creates a Changefeed::Raw on query
Unsafe method until .where
can accept more generic arguments
Makes 2 LARGE assumptions
- User correctly scopes the query under the right table
- User forms a query that returns a collection of models
Should raise/not compile on malformed query/incorrect return type to create a collection
Returns documents for which predicate block is true
Instance Method Detail
Returns true
if this reference is the same as other. Invokes same?
.
Accept HTTP params