CRUD

Create (add), Read (select), Update, Delete.

db.add()

Inserts rows into tables. See Add for more information.

Usage

db.add(...)

Parameters:

  • A database model instance.

db.all()

Returns all rows from a table. See Select for more information.

Usage

db.all()

Parameters:

- None

db.get()

Selects rows by id/primary key. See Select for more information.

Usage

db.get(...)

Parameters:

  • The id/primary key

    • Same datatype as the primary key in the model (usually an integer).

db.get_by()

Selects all rows from a table that matches one or more columns. See Select for more information.

Usage

db.add(...)

Parameters:

  • A series of named parameters.

    • db.get_by(column=value, other_column=other_value)

db.save()

Saves/commits changes made to a table. You need to save after updating or deleting a row. See this page for more information.

Usage

db.save()

Parameters:

- None

db.delete()

Deletes rows in tables. See Delete for more information.

Usage

db.delete(...)

Parameters:

  • Query object

Last updated