pub mod admin;
pub mod error;
pub mod extension;
pub mod lifecycle;
pub mod models;
pub mod projection;
#[macro_use]
pub mod repository;
pub mod resilience;
pub mod services;
pub use extension::DatabaseExtension;
pub use models::{
ColumnInfo, DatabaseInfo, DatabaseQuery, DatabaseTransaction, DbValue, FromDbValue, IndexInfo,
JsonRow, QueryResult, QueryRow, QuerySelector, TableInfo, ToDbValue, escape_like,
parse_database_datetime,
};
pub use services::{
BoxFuture, BudgetedDb, Database, DatabaseCliDisplay, DatabaseExt, DatabaseProvider, DbPool,
PoolConfig, PostgresProvider, SchemaEpoch, SqlExecutor, with_transaction_retry,
};
pub use error::DatabaseResult;
pub use lifecycle::{
AppliedMigration, BOOTSTRAP_ADVISORY_LOCK_KEY, BackfillStatement, BaselineStamp,
BootstrapLockGuard, BootstrapLockTimeout, ChecksumDrift, DeferredForeignKey,
ExpensiveStatement, ExtensionMigrationStatus, FkDeferralError, ForeignKeyDrift, FreshnessCheck,
HOT_TABLES, MarkAppliedOutcome, MigrationConfig, MigrationCost, MigrationResult,
MigrationService, MigrationStatus, OrphanMigrationLedger, OrphanedMigration,
PROJECTION_BACKLOG, PendingMigration, RETRYABLE_SQLSTATES, RepairResult, ReplicaStatus,
SchemaAhead, SchemaCurrency, SchemaInstallReport, SchemaResidue, SlotCollision,
SplitCreateTable, TombstonedSlot, UndeclaredTable, audit_migration_cost, audit_one,
audit_schema_residue, backfill_statements, check_migration_references, check_trigger_routines,
install_extension_schemas_full, is_retirement, is_retryable_lock_conflict,
is_retryable_sqlstate, projection_tables, replica_status, schema_catalog_digest,
schema_currency, split_create_table_foreign_keys, validate_column_exists,
validate_database_connection, validate_table_exists, validate_write_pool_is_primary,
};
pub use repository::{
CLAIM_DEAD_PEER_SECS, CoordinationRepositories, CreateServiceInput, EXTENSION_LOCK_CLASS,
INSTANCE_CLAIM_CLASS, INSTANCE_DEAD_AFTER_SECS, InstanceClaim, InstanceClaimError,
InstanceLeaseRepository, PLANE_NOT_APPLIED_HINT, PROCESS_OWNERSHIP_CHANNEL, PgConfigVersion,
PgDbPool, PlaneTransaction, ProcessOwner, ProcessOwnershipWake, Reaped, ReapedService,
ReleaseGate, ReleaseRun, ReleaseStampError, ReleaseStampRepository, RoleCount, ServiceConfig,
ServiceModule, ServiceRepository, ServiceStatus, SessionAdvisoryLock, SessionAdvisoryLocks,
StampOutcome, UpsertServiceProcessInput, find_config_plane_applied,
record_config_plane_applied, release_key, with_change_context,
};
pub use admin::{
AdminSql, AdminSqlError, DEFAULT_READONLY_ROW_LIMIT, DatabaseAdminService, IdentifierError,
QueryExecutor, QueryExecutorError, SafeIdentifier,
};
use systemprompt_traits::DatabaseHandle;
impl DatabaseHandle for Database {
fn is_connected(&self) -> bool {
!self.pool().is_closed() && !self.write_pool().is_closed()
}
fn as_any(&self) -> &dyn std::any::Any {
self
}
}