API Documentation¶
- class estoult.Association¶
Bases:
objectOne to One/Many associations to help translate between relational data and object data.
Many to Many is currently not supported because it does not translate well into an object structure.
- static has_many(schema, on=[])¶
- static has_one(schema, on=[])¶
- class estoult.Field(type, name=None, caster=None, null=True, default=None, primary_key=False)¶
Bases:
objectA schema field, analogous to columns on a table.
- Parameters:
type (type) – Basic datatype of the field, used to cast values into the database.
name (str, optional) – The column name of the field, will default to the variable name of the field.
caster (callable, optional) – A specified caster type/function for more extensive casting.
null (bool, optional) – Field allows nulls.
default (optional) – Default value.
primary_key (bool, optional) – Field is the primary key.
- property full_name¶
- class estoult.Query(schema)¶
Bases:
object- copy()¶
- delete()¶
- execute() Any¶
- full_join(schema, on)¶
- full_outer_join(schema, on)¶
- get(*args)¶
- get_or_none(*args)¶
- inner_join(schema, on)¶
- left_join(schema, on)¶
- left_outer_join(schema, on)¶
- limit(*args)¶
- order_by(*args)¶
- preload(association)¶
- right_join(schema, on)¶
- right_outer_join(schema, on)¶
- select(*args)¶
- union(schema)¶
- update(changeset)¶
- where(*clauses)¶
- class estoult.Schema¶
Bases:
objectA schema representation of a database table.
- Variables:
_allow_wildcard_select – Determines if wildcards can be used when ‘selecting’.
- classmethod delete(row)¶
- classmethod delete_by_pk(id)¶
- classmethod insert(obj)¶
- classmethod update(old, new)¶
- classmethod update_by_pk(id, new)¶
- class estoult.fn¶
Bases:
object- classmethod add_fn(name, sql_fn)¶
Adds an additional function to the module.
- Parameters:
name (str) – What the name of the function should be called.
sql_fn (str) – The SQL function it is turned into.
- static alias(lhs, rhs)¶
- static avg(*args)¶
- static cast(lhs, rhs)¶
- static ceil(*args)¶
- static concat(*args)¶
- static count(*args)¶
- static distinct(*args)¶
- static max(*args)¶
- static min(*args)¶
- static sum(*args)¶
- class estoult.op¶
Bases:
object- static add(*args)¶
- classmethod add_op(name: str, op: str) None¶
Adds an operator to the module.
- static and_(lhs, rhs)¶
- static eq(*args)¶
- static ge(*args)¶
- static gt(*args)¶
- static ilike(*args)¶
- static in_(lhs, rhs)¶
- static is_null(*args)¶
- static le(*args)¶
- static like(lhs, rhs)¶
- static lt(*args)¶
- static mod(*args)¶
- static mul(*args)¶
- static ne(*args)¶
- static not_(*args)¶
- static not_null(*args)¶
- static or_(lhs, rhs)¶
- static sub(*args)¶
- static truediv(*args)¶