Ask Documentation
WebsiteGitHubPyPI
  • Introduction
  • Getting Started
    • Install & Get Started
    • Hello, World!
  • Routes & Requests
    • Routes
    • Defining Routes
    • Request Data
    • HTTP Status Codes & Methods
    • CORS
  • Response
    • JSON Response
    • JSON Response With an HTTP Status Code
  • Classes
    • Class Instance Variable
    • Initialization/Constructor Method
  • Data Types
    • Dictionaries
  • Built-in Utilities
    • Quick_set()
    • Deep()
    • Serialize()
    • Require_keys()
    • Random Generators
    • Pattern Matching
    • Email
  • Database
    • Ask and Databases
    • Models/Classes
      • Columns
      • Initialization/Constructor
      • Serialization
      • The &basic decorator
    • CRUD
      • Add
      • Select
      • Update
      • Delete
    • Check if a Row Exists
    • Sorting
    • Database Lists
  • JWT Authentication
    • Introduction
    • Protecting Routes
    • How to Create a Basic Login System
    • Properties & Methods of _auth
    • Making Requests to Protected Routes
  • Decorators
    • What are Decorators?
    • Create and Use Custom Decorators
    • Built-in Decorators
  • Security
    • Hashing
    • Route Security
    • Environment Variables
  • Configuring the Transpiler
  • Askfile.toml
  • Modules & Libraries
    • Importing an Ask Module
    • Includes
    • Importing Python Modules
  • Development Tools
    • Editor Syntax Highlighting
    • Automatic API documentation
    • CLI Flags
    • Running in development mode
    • Versioning System
  • Contribute
    • Feature Requests
    • Bug Reports
    • Contribute Code
Powered by GitBook
On this page
  • db.add()
  • Usage
  • db.all()
  • Usage
  • db.get()
  • Usage
  • db.get_by()
  • Usage
  • db.save()
  • Usage
  • db.delete()
  • Usage
Export as PDF
  1. Database

CRUD

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

PreviousThe &basic decoratorNextAdd

Last updated 4 years ago

db.add()

Inserts rows into tables. See for more information.

Usage

db.add(...)

Parameters:

  • A database model instance.

db.all()

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

Usage

db.all()

Parameters:

- None

db.get()

Usage

db.get(...)

Parameters:

  • The id/primary key

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

db.get_by()

Usage

db.add(...)

Parameters:

  • A series of named parameters.

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

db.save()

Usage

db.save()

Parameters:

- None

db.delete()

Usage

db.delete(...)

Parameters:

  • Query object

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

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

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

Deletes rows in tables. See for more information.

Delete
Add
Select
Select
Select
this page