41 Commits
Author SHA1 Message Date
pnoker ba6406bd60 feat(db): add mariadb and mysql dependency modules
Add Dockerfiles under dc3/dependencies for MariaDB and MySQL that layer on the dc3-mariadb-base/dc3-mysql-base images published by dc3-docker (2026.6), matching the dc3-postgres layering convention. Nothing is layered yet since DC3 runs on the PostgreSQL dialect; credentials, seeds, and entrypoint overrides land here when a MariaDB/MySQL profile is needed.
2026-09-03 09:03:47 +08:00
pnoker eae86b58fc refactor(storage)!: unify platform persistence on reactive postgresql
- migrate auth, manager, data, and agentic persistence to R2DBC
- hard cut pagination, facade, gateway, web, and CLI contracts
- remove legacy database and TSDB adapters and document validation gates

BREAKING CHANGE: platform persistence now requires PostgreSQL 18 with TimescaleDB and the new reactive API contracts.
2026-09-01 22:03:16 +08:00
pnoker 7610b8dadd fix(db): harden mysql/mariadb dialects and seed conversion
- derive pagination DbType from the selected dc3-db adapter with a fail-fast
  when a non-default dc3.db.type lacks its adapter jar
- skip postgres profile activation for mariadb, not just mysql
- fork OAuthMcpMapper/AlertMapper statements for mysql and mariadb
  (CAST AS JSON, ::text casts, ODKU value references)
- honor GET_LOCK verdict in resource registry sync instead of assuming
  acquisition on every engine
- pg2mysql_seed.py: convert partial unique indexes to stored generated guard
  columns instead of dropping them; add 99-iot-dc3-grants.sql
- add DC3_DB_URL/DC3_DB_HISTORY_URL per-service overrides in center configs
- cover the new mapper forks in the db TCK; fix AGPL headers in spring
  metadata files
2026-08-25 19:27:44 +08:00
pnoker c71b420248 docs(headers): add the missing agpl headers to deploy and config files
- add the canonical AGPL header to the six agentic application yml files and the two python scripts that lacked one
- add the header to all 79 kustomize, helm, and grafana yaml files, including the k8s driver template which regenerates the 36 driver manifests
- verified: the k8s yaml files parse (multi-document aware), the python scripts compile, and the regenerated drivers differ only by the header
2026-08-25 16:13:47 +08:00
pnoker 769d1cb977 style: apply repository-wide formatting
- expand single-line Javadocs to multi-line blocks, rewrap Markdown prose, and reflow POM, YAML, and TypeScript formatting
- formatting only: no Java code lines changed, no build-file semantics changed
- verified: backend compile and check_documentation.py pass, pnpm check and pnpm lint:check pass, and the dc3 YAML files parse
2026-08-25 13:35:00 +08:00
pnoker de656d293c feat(db): add the mariadb adapter — third engine certified, 24/24 across the family
dc3-db-mariadb brings MariaDB 10.6+ behind dc3.db.type=mariadb with the
official mariadb-java-client and the same dual-dialect contract suite.
MariaDB shares the MySQL seed wholesale (utf8mb4_unicode_ci — the 0900
collation is MySQL-8-only and MariaDB rejects it outright, so the seed
translator and the hand-written 05 both moved to the portably-supported
collation, re-verified against mysql:8.4).

The mapper forks differ from the mysql twins in exactly one dimension,
verified against a live 10.11 container first: MariaDB never adopted
the AS-new ODKU row alias (syntax error on 10.11), so its 15 twins
reference VALUES(col) instead — everything else (GET_LOCK/RELEASE_LOCK,
FOR UPDATE SKIP LOCKED, recursive CTEs, INTERVAL ? SECOND, the
JSON_UNQUOTE(JSON_EXTRACT(...)) double-hop, REGEXP_REPLACE without the
g flag, DAYOFWEEK/HOUR units) proved compatible and rides the same
statement bodies.

Scope decision recorded in docs/db-dialects.md: DB2, H2 and HSQLDB are
explicitly out (dialect cost with zero demand; embedded test databases
unfit for multi-service concurrent IoT writes), SQLite equally unfit
for the multi-service shape (database-level write lock, no network
listener). Oracle and SQL Server stay on the roadmap with their real
obstacles spelled out (MERGE-heavy rewrite; no ARM64 mssql image for
local certification on Apple Silicon) — not started without a demand
signal.

Gates: db-tck 24/24 (postgres + mysql + mariadb, 8 each),
data/auth/manager suites green (274 in data), full-repo compile green.
2026-08-24 20:01:48 +08:00
pnoker 76ae89370b feat(db): add the mysql seed — dual-engine initdb, row-level revision triggers
R2b of docs/design/storage-abstraction.md §3:

- PostgreSQL seed: the three driver-lease sequences retire. The fencing
  token and assignment version default to 1 and advance row-locally —
  per-device / per-driver monotonicity is the property the checks rely
  on, which the global sequences only delivered incidentally, and MySQL
  has no sequence objects. The three statement-level revision triggers
  (transition tables + INSERT .. ON CONFLICT, none of which MySQL can
  express) collapse into one row-level function with row-local +1 upserts
  — a shape both engines share.

- MySQL seed under dc3/dependencies/mysql/initdb/ (00-06), derived by
  dc3/dependencies/mysql/pg2mysql_seed.py: schemas become databases,
  TIMESTAMPTZ becomes DATETIME(6), TEXT/JSON literal defaults become
  expression defaults (MySQL 8 refuses literal defaults on BLOB/TEXT/
  JSON), operate-time plpgsql triggers become the ON UPDATE column
  attribute (explicit SETs keep winning), the revision family becomes
  row-level DELIMITER triggers, keyed TEXT columns widen to VARCHAR(191),
  partial indexes drop, and the embedded-JSON seed values load under
  NO_BACKSLASH_ESCAPES (MySQL string literals eat the backslashes the
  escaped-JSON content values depend on; PostgreSQL does not). 05 is
  hand-maintained: only the dc3_point_latest projection — a MySQL core
  requires an external time-series store, so the hypertable and cagg DDL
  have no counterpart by design.

- Compose: the optional stack gains a mysql:8.4 service (utf8mb4, seed
  mounted at docker-entrypoint-initdb.d, healthcheck); the app stack
  passes DC3_DB_TYPE through.

Verified by loading all seven files into a fresh mysql:8.4 container —
zero errors, five databases, table counts aligned with the PostgreSQL
seed (manager 24 incl. common, auth 24, data 12, agentic 6, history 1),
and the revision trigger proven live: insert bumps the owning driver's
revision to 1, an enable_flag flip bumps it again to 2.
2026-08-24 17:17:45 +08:00
pnoker c2a15d73e9 chore: reorganize api files into idea/ subdirectory and remove obsolete bin scripts 2023-03-09 02:03:31 +08:00
pnoker bbb58de423 feat: replace Eureka with Nacos for service discovery across all modules 2023-03-08 03:48:05 +08:00
pnoker 73bd32e5c0 chore(db): revamp initial SQL schema and add service definitions to docker-compose 2023-03-07 23:01:49 +08:00
pnoker 432b7aa900 refactor(auth): migrate auth gRPC APIs from proto-based dc3-api to inline Java API classes 2023-03-06 00:42:26 +08:00
pnoker d3e982cf2c refactor(api): migrate dto and feign client annotations across all modules 2023-03-02 02:16:53 +08:00
pnoker 3b24c7c8b0 feat(db): rewrite mysql init script with expanded schema and seed data 2023-03-02 00:06:37 +08:00
pnoker 2c34fa08c0 refactor(api): standardize page query param names across all feign clients and dtos 2023-03-01 01:25:01 +08:00
pnoker bd9bf26a21 build: add jvm and maven config files and split application profiles into pre and pro 2023-02-16 04:36:01 +08:00
pnoker 4c68584f00 refactor(center): rename TopicConfig classes and remove redundant application yml properties 2023-01-09 00:43:27 +08:00
pnoker 12fc2cece9 refactor(center): replace mongo with new topic config and restructure data and manager modules 2023-01-08 17:19:37 +08:00
pnoker dd021d13d6 feat: V2022.2.1 2023-01-02 20:36:16 +08:00
pnoker dadde9c216 feat: V2022.1.9 2022-12-28 01:48:28 +08:00
pnoker c478f7a0e7 feat: V2022.1.8 2022-12-27 20:30:13 +08:00
pnoker 4887f8006e feat(db): rewrite mysql init script with reorganized schema definitions 2022-12-23 00:09:45 +08:00
pnoker 4c30bd13bb refactor(api): update feign client method signatures and response wrappers across all modules 2022-11-27 23:58:06 +08:00
pnoker d113db8cb1 refactor: migrate base package from com.dc3 to io.github.pnoker 2022-11-18 21:14:54 +08:00
pnoker 5be75c8dfd feat: update code 2022-08-06 00:00:03 +08:00
pnoker 45f90460dc refactor(data): extract repository strategy pattern and expand manager list/detail apis 2022-07-30 16:42:04 +08:00
pnoker 61d615a9b1 refactor: change entity id type from long to string across all modules 2022-06-19 23:55:02 +08:00
pnoker fb299e4ee2 refactor: restructure feign clients, add driver command client, and reorganize sdk 2022-05-23 00:09:07 +08:00
pnoker 3e070cb062 fix(pom): reorganize dependencies and add profiles/sdk common modules 2021-08-15 16:16:03 +08:00
pnoker c0db070266 feat(edge-gateway): add a new type driver: edge-gateway 2021-08-02 14:55:50 +08:00
pnoker 2ee8a0f998 feat(driver): add driver type 2021-08-02 14:19:07 +08:00
pnoker 8e4b4e5474 refactor(data): make profile standalone and associate device directly with driver in schema 2021-06-02 11:13:02 +08:00
pnoker 3acf7cd020 refactor(manager): rebind driver info from profile to device 2021-06-01 20:24:52 +08:00
pnoker 7327710f8b feat(manager): add ProfileBind entity, mapper, service and schema table 2021-06-01 18:26:23 +08:00
pnoker 0846b2ce09 refactor(auth): simplify TenantBind model and schema structure 2021-06-01 18:23:29 +08:00
pnoker 12778704fe feat(common): add enable field to driver, profile, point, and device models 2021-05-30 14:01:15 +08:00
pnoker c31a1ab029 feat(db): update mysql schema with new fields and table structure 2021-05-28 01:19:03 +08:00
pnoker 76ab3fca09 feat(auth): implement multi-tenant support with tenant feign client and dictionary api 2021-05-20 23:02:49 +08:00
pnoker 2e3f2c6202 chore: add travis ci config and clean up feign client imports across all api modules 2021-04-11 10:03:27 +08:00
pnoker 448beff21a feat(common): add tenantId field to domain models and adjust ID type 2021-04-06 22:06:40 +08:00
pnoker 31c9fcafcb build(docker): update base image and JVM settings across all service Dockerfiles 2021-01-12 22:16:08 +08:00
pnoker f2d4052128 refactor: rename dependences to dependencies and remove unused IndexApi 2020-10-23 21:26:40 +08:00