Skip to content

PyO3 Native Extension Stubs

Low-level Rust classes and functions declared in PEP 561 .pyi stub files across Vertebra's compiled extension modules. Each extension is built with gil_used = false for free-threaded Python. Most applications use these through the higher-level vertebra, vertebra.server, vertebra.db, and vertebra.storage APIs.

Native Module Backing Crate Scope
vertebra._vertebra vertebra-py, vertebra-core, vertebra-http, vertebra-db Request and response views, protocol scopes, shared-memory cache, and core IPC bridge.
vertebra._bundler vertebra-bundler Oxc and Rolldown asset bundling, QuickJS SSR pool, and .d.ts declaration generation.
vertebra._storage vertebra-storage Sync and async object storage backed by Rust object_store and Tokio.
vertebra._bigquery vertebra-bigquery BigQuery REST v2 queries and Storage Read/Write gRPC streams.
vertebra._duckdb vertebra-duckdb Bundled DuckDB 2.0 client with shared-memory Arrow output.
vertebra._mssql vertebra-mssql SQL Server TDS 7.4 client with bulk load and Arrow output.
vertebra._mysql vertebra-mysql MySQL binary protocol client with Arrow output.
vertebra._oracle vertebra-oracle Oracle 26ai Thin client, connection pools, and notification listeners.
vertebra._postgres vertebra-postgres PostgreSQL Protocol 3.0 client, pools, COPY, pgoutput replication, and Arrow output.
vertebra._spanner vertebra-spanner Cloud Spanner data and admin client.
vertebra._sqlite vertebra-sqlite Bundled SQLite 3.45+ client with WAL pooling and Arrow output.
vertebra._redis vertebra-redis RESP3 Redis client with client-side caching, Sentinel, and Cluster support.
vertebra._valkey vertebra-valkey RESP3 Valkey client with hash-field expiration, client-side caching, Sentinel, and Cluster support.

Core Runtime & Protocol Views

Request

Attributes:

Name Type Description
bodybytes | None
body_viewmemoryview
flagsint
handler_idint
headersHeaders
http_versionstr
methodstr
pathstr
querystr | None
raw_pathbytes
raw_querybytes
request_idint

as_dict

as_dict()

asgi_scope

asgi_scope(root_path=None)

from_parts

from_parts(method, path, body=None, request_id=1, handler_id=1, headers=None)

rsgi_protocol

rsgi_protocol()

rsgi_scope

rsgi_scope(
    scheme="http", server="127.0.0.1:8000", client="127.0.0.1:0", root_path=""
)

wsgi_environ

wsgi_environ(server_name=None, server_port=None, url_scheme=None)

Headers

as_dict

as_dict()

asgi_items

asgi_items()

from_pairs

from_pairs(pairs)

get

get(key, default=None)

get_all

get_all(key)

items

items()

keys

keys()

values

values()

Response

Attributes:

Name Type Description
bodybytes
headerslist[tuple[bytes, bytes]]
request_idint
statusint

error

error(status, request_id=0)

from_buffer

from_buffer(status, body, headers=None, request_id=0)

from_file

from_file(
    path, status=200, headers=None, request_id=0, offset=None, length=None
)

to_bytes

to_bytes()

RequestBatch

AsgiScope

RsgiScope

Attributes:

Name Type Description
authoritystr | None
clientstr
headersHeaders
http_versionstr
methodstr
pathstr
protostr
query_stringstr
root_pathstr
rsgi_versionstr
schemestr
serverstr

WsgiEnviron

ShmCache

Cross-worker POSIX shared-memory key-value cache with optimistic seqlock reads and CLOCK eviction.

Attributes:

Name Type Description
capacityint

ShmCacheStats

Hit/miss, set, and eviction counters for a shared-memory ShmCache.

Attributes:

Name Type Description
capacityint

Total slot capacity of the cache.

max_entriesint

Configured maximum entries in the cache.

capacity_bytesint

Total allocated capacity in bytes.

hitsint

Cumulative cache lookup hits.

missesint

Cumulative cache lookup misses.

setsint

Cumulative cache set operations.

evictionsint

Cumulative CLOCK-sweep cache evictions.

expirationsint

Cumulative expired slot hits.

Bundler & QuickJS SSR

BundleConfig

Attributes:

Name Type Description
entrystr
outdirstr
minifybool
sourcemapbool
targetstr

BundleDevConfig

Attributes:

Name Type Description
entrystr
watch_dirslist[str]
hmr_portint
extensionslist[str]
debounce_msint

BundleResult

Attributes:

Name Type Description
outputslist[BundleOutput]
duration_msint
warningslist[str]

BundleOutput

Attributes:

Name Type Description
pathstr
sizeint
is_entrybool

Bundler

Attributes:

Name Type Description
configBundleConfig | None
dev_configBundleDevConfig | None

from_config

from_config(config, *, dev_config=None)

build

build(config=None)

start_dev

start_dev(config=None)

stop_dev

stop_dev()

poll_events

poll_events(timeout_ms=None)

transform_file

transform_file(path, source)

check_file

check_file(path, source)

notify_type_change

notify_type_change(version=None)

notify_reload

notify_reload()

hmr_url

hmr_url()

is_dev_mode

is_dev_mode()

SSRPool

Attributes:

Name Type Description
generationint
cache_lenint

IsolatedDeclarationsGenerator

Object Storage

StorageBuffer

ObjectMeta

Attributes:

Name Type Description
pathstr
sizeint
last_modifiedstr
etagstr | None
versionstr | None
content_typestr | None
attributesdict[str, str]
sha256str | None
crc32cstr | None
md5str | None

SyncObjectStore

Attributes:

Name Type Description
schemestr
supports_atomic_renamebool

AsyncObjectStore

put(path, data, *, content_type=None, attributes=None, if_not_exists=False, if_match=None, if_none_match=None, checksum=False, expected_sha256=None, expected_crc32c=None, expected_md5=None)

get(path, *, expected_sha256=None)

head(path)

delete(path)

list(prefix=None)

copy(src, dst, *, if_not_exists=False)

BigQuery & Spanner

SyncBigQueryClient

Synchronous pure-Rust Google Cloud BigQuery REST v2 and Storage Read/Write client.

ca_pem applies to the REST API client; the Storage Read and Write API clients use the system trust store and ignore it.

AsyncBigQueryClient

Asynchronous pure-Rust Google Cloud BigQuery REST v2 and Storage Read/Write client.

ca_pem applies to the REST API client; the Storage Read and Write API clients use the system trust store and ignore it.

SyncSpannerClient

Synchronous Google Cloud Spanner client built on the official Rust client.

query and partitioned_query return columns, schema, rows, row_count_exact, and row_count_lower_bound. ca_pem is accepted only for non-googleapis https:// endpoints (Spanner Omni or private test servers).

AsyncSpannerClient

Asynchronous Google Cloud Spanner client built on the official Rust client.

query and partitioned_query return columns, schema, rows, row_count_exact, and row_count_lower_bound. ca_pem is accepted only for non-googleapis https:// endpoints (Spanner Omni or private test servers).

DuckDB

SyncDuckDBClient

Synchronous native DuckDB 2.0 client bridged via SyncCompletionQueue.

AsyncDuckDBClient

Asynchronous native DuckDB 2.0 client bridged via AsyncCompletionQueue and Notifier.

SQL Database Drivers

Each SQL database extension exports GIL_USED = False and FREE_THREADED alongside its sync and async clients, connection pools, listeners, and replication types.

AsyncPostgresClient

Asynchronous physical PostgreSQL Protocol 3.0 client.

AsyncPostgresReplication

Dedicated non-pooled asynchronous PostgreSQL logical replication stream handle.

SyncOracleClient

SyncMySQLClient

SyncMSSQLClient

SyncSQLiteClient

Synchronous native SQLite 3.45+ client bridged via dedicated worker threads.

AsyncSQLiteClient

Asynchronous native SQLite 3.45+ client bridged via Tokio and completion drainer.

Redis & Valkey Drivers

vertebra._redis and vertebra._valkey expose sync and async clients, pub/sub listeners, and pipelines with RESP3 framing, client-side caching invalidations, Sentinel, and Cluster routing. vertebra._valkey adds Valkey 9.0 hash-field expiration and CLIENT CAPA redirect.

AsyncRedisClient

SyncRedisClient

AsyncValkeyClient

Asynchronous pure-Rust Valkey 8.0+/9.0 client backed by Tokio completion queue.

SyncValkeyClient

Synchronous pure-Rust Valkey 8.0+/9.0 client releasing the GIL across I/O.