Defines database-agnostic UUID and timestamp types, plus SQL generation for PostgreSQL and SQLite.
# Source: https://github.com/PrefectHQ/prefect | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""
Utilities for interacting with Prefect REST API database and ORM layer.
Prefect supports both SQLite and Postgres. Many of these utilities
allow the Prefect REST API to seamlessly switch between the two.
"""
from __future__ import annotations
import datetime
import json
import operator
import re
import uuid
from functools import partial
from typing import (
TYPE_CHECKING,
Any,
Callable,
Optional,
Type,
Union,
overload,
)
from zoneinfo import ZoneInfo
import pydantic
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql, sqlite
from sqlalche
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key