Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
01Edu AI framework for Sqlite & Deno based app
context
Keep track of information for each web request, like the URL and session. This lets you easily get the current request's details from anywhere.
A function that returns the current request's context.
Returns the current request's context. If no context is found, it returns a default context.
A function that creates a new request context. Useful for testing or running background jobs.
Creates a new request context. Useful for testing or running background jobs.
A function that runs a callback within a specific request context. This is the foundation of how the context is managed across asynchronous operations.
Runs a callback within a specific request context, making it available via getContext.
This is essential for ensuring that context is not lost in asynchronous operations.
db
Create and interact with SQLite database tables. You define the table's columns, and it automatically generates functions to insert, update, find, and run custom SQL queries on that table, reducing sql boilerplate.
Creates a new database table and returns an API for interacting with it.
The main database connection.
It is a singleton instance of the Database class from the @db/sqlite module.
Creates a restore point for the database, for use in testing environments. This function will throw an error if called in a production environment.
Represents a row from a database table, with type inference based on the table properties.
A template literal tag for executing arbitrary SQL queries.
A template literal tag for creating a SQL query that checks for the existence of something.
Defines the structure of a database table's columns.
entries
Setup Entries, this is made for applications that want to be organized with entries as a generic fact representing all of the app state and changes. This takes inspiration from star schema and event sourcing. Entries additionally share concepts with our context module to embed structural request information like the session automatically per entry
Initializes the entry system, creating tables, views, and an API for interacting with entries. Entries are a generic way to represent state changes and events in the application.
env
Util to define event variable with default fallback.
Also define and share the expected APP_ENV required by our apps.
The current application environment, determined by the APP_ENV environment variable.
Defaults to 'dev' if not set.
The possible application environments.
The git commit SHA of the current build, typically provided by a CI/CD system.
An authentication token for a developer tool service.
The URL for a developer tool service.
Retrieves an environment variable by key. Throws an error if the variable is not set and no fallback is provided.
log
Add support for sending logs to our devtools. Our Logger also help shapping logs and recognize our context module.
Initializes and returns a logger instance.
The logger's behavior depends on the application environment (APP_ENV).
In 'prod', it batches logs and sends them to a remote devtool service.
In 'dev', it logs to the console with pretty colors and call chain information.
In 'test', it logs to the console with timestamps.
migration
Rely on sqlite PRAGMA user_version to apply migrations
Runs database migrations from a specified directory.
Migrations are applied in order based on the version number in their filename.
It uses the user_version pragma in SQLite to keep track of the current database version.
response
Set of simple shortcuts for creating standard JSON web responses for every HTTP status code, like respond.OK() or respond.NotFound(). It also automatically creates corresponding error classes for HTTP errors, so you can easily throw a NotFoundError in your code. This interact with our provided server to allow errors that can be used by both application code and to build http response.
A collection of utility functions and error classes for creating standard Response objects.
A custom error class that encapsulates a Response object.
This is the base class for all HTTP errors created by the respond object.
router
Type-safe HTTP Router module.
Descriptor for a handler that may authorize a session and convert input to output.