Add multi-database data layer

Introduce aether-data-schema and driver-specific schema generation for Postgres, MySQL, and SQLite.

Split data backends, lifecycle, repositories, and gateway runtime integration across database drivers.

Verified with cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace.
This commit is contained in:
fawney19
2026-05-05 18:27:36 +08:00
parent 099653f732
commit fce7e959e5
372 changed files with 86217 additions and 21160 deletions

View File

@@ -0,0 +1,47 @@
-- Generated by aether-data-schema from schema/logical/*.toml.
-- Do not edit generated files directly; edit logical schema or explicit overrides instead.
CREATE TABLE IF NOT EXISTS public.proxy_nodes (
id character varying(64) NOT NULL,
name character varying(255) NOT NULL,
ip character varying(512) NOT NULL,
port integer NOT NULL,
region character varying(100),
status character varying(32) DEFAULT 'online' NOT NULL,
registered_by character varying(64),
last_heartbeat_at bigint,
heartbeat_interval integer DEFAULT 30 NOT NULL,
active_connections integer DEFAULT 0 NOT NULL,
total_requests bigint DEFAULT 0 NOT NULL,
avg_latency_ms double precision,
is_manual boolean DEFAULT false NOT NULL,
proxy_url character varying(500),
proxy_username character varying(255),
proxy_password character varying(500),
created_at bigint NOT NULL,
updated_at bigint NOT NULL,
remote_config jsonb,
config_version integer DEFAULT 0 NOT NULL,
hardware_info jsonb,
estimated_max_concurrency integer,
tunnel_mode boolean DEFAULT false NOT NULL,
tunnel_connected boolean DEFAULT false NOT NULL,
tunnel_connected_at bigint,
failed_requests bigint DEFAULT 0 NOT NULL,
dns_failures bigint DEFAULT 0 NOT NULL,
stream_errors bigint DEFAULT 0 NOT NULL,
proxy_metadata jsonb
);
ALTER TABLE ONLY public.proxy_nodes ADD CONSTRAINT proxy_nodes_pkey PRIMARY KEY (id);
CREATE TABLE IF NOT EXISTS public.proxy_node_events (
id bigserial NOT NULL,
node_id character varying(64) NOT NULL,
event_type character varying(64) NOT NULL,
detail character varying(500),
created_at bigint NOT NULL
);
ALTER TABLE ONLY public.proxy_node_events ADD CONSTRAINT proxy_node_events_pkey PRIMARY KEY (id);