Global Functions¶
connect(url, auto_migrate=False)
async
¶
Establish a connection to the database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
The database connection string (e.g., "sqlite:example.db?mode=rwc"). |
required |
auto_migrate
|
bool
|
If True, automatically create tables for all registered models. |
False
|
Source code in src/ferro/__init__.py
transaction()
async
¶
Run database operations inside a transaction context
Yields control to the caller within an open transaction.
Examples: