Commits
Commits on
af331ecc8a4a0c661bcdbc905b95bb2cf77a72de2026-09-12
🐛 fix: gate the registration seat bump on the holder's role (Gamze's find)Ahmet Kaan Gümüş · af331ecBrowse files
🧪 test: port T4 regress/partial-patch suites to the Postgres harnessAhmet Kaan Gümüş · f553d14
🧪 test: port T4 regress/partial-patch suites to the Postgres harness - fixture SQL → runtime sqlx (kind_ref/slot_ref upserts, settings JSONB, point-row UPDATEs, count/scalar helpers); ULID idioms re-pointed - SurrealDB DEFINE EVENT injections → PG-native: RAISE triggers (roles/ classes/blueprints pending), pg_sleep window trigger (exam delete), lock-queueing probe (attendance), row-snapshot probe (badge awards) - EXTRA: drop DB_KEEPALIVE_INTERVAL_SECS/DB_PING_TIMEOUT_SECS + their /limits EXCLUDED pins; drop stale BOARD_OPEN_GUARD pin (wave-2 leftover) - production fixes pinned by these suites: exam_result grade claim mints an absent kind_ref (absent = in service); field_update run() emitted a double WHERE (every guarded PATCH 500'd); attendance event mark now locks the event row (orphan race); admin floor takes the admin-set row locks (cross-target demotions raced); profile focus sum cast to BIGINT - delete the two appointment store-property tests: their subject was the SurrealDB engine's write-skew; Postgres closes it by constraint - .sqlx refreshed for the changed query macros
🧪 test: port e2e, rate_limit, ai_bridge, ai_protocol to the Postgres harnessAhmet Kaan Gümüş · e0e3597
🧪 test: port e2e, rate_limit, ai_bridge, ai_protocol to the Postgres harness e2e: spawn_server_with_ai re-pointed at init_test_tenants; the board helpers read and seed through runtime sqlx (stroke ids, payloads, epoch, participants roster); promote writes app_user; ULID literals became common::ABSENT_ID. rate_limit: the durable-window trio stands on one control database's rate_limit table (two UserRateLimiters, pools dialed before the clock freezes); fold reads are query_scalar; the down-database leg takes the fold's table away and hands it back instead of flipping the deleted health flag; embedded-engine caveats deleted. ai_bridge/ai_protocol: bootstrap renames plus the chatbot history seed inserted over sqlx; the down-socket test outages the school registry table and recovers, keeping both original assertions. src/rate_limit.rs: rebuilt the wave-1-deleted epoch-roll unit test (a_wall_epoch_roll_charges_no_request_twice + its admits helper) over the control database, driving sync_once's epochs directly.
🐛 fix: rename app_user in the six FromRow entities the port missedAhmet Kaan Gümüş · 0466c1a
🐛 fix: rename app_user in the six FromRow entities the port missed
PagedList reads with SELECT * + FromRow need field names to match
columns; Attendance, Enrollment, ExamAttempt, ExamResult, ExamAnswer
and AnswerImage carried a bare `user` field, so any paged read 500'd
with a database error (found live by e2e's full_user_journey via
GET /events/{id}/attendance). Attribute-only: query_as! sites are
unaffected, no .sqlx refresh needed.🗃️ fix: macro-legal binds/decodes + Send-general closures (repair round, 1564→0)Ahmet Kaan Gümüş · 83c3ce5Browse files
🗃️ feat: From<Option<String>>/From<Option<i64>> for Param (L8/L10 clearable columns)Ahmet Kaan Gümüş · b26cabbBrowse files
🗃️ fix: un-splice EventAudience struct from EventAudienceKind::as_str match (L10 merge defect)Ahmet Kaan Gümüş · e4b7f45Browse files
🗃️ wip(l10): macro-typed queries (arg conversions + AS overrides), appointment lock removal, slot Option portAhmet Kaan Gümüş · 8243707Browse files
🗃️ feat!: port classes (group/member/course/blueprint/pump) to sqlx/PostgresAhmet Kaan Gümüş · dec7a2aBrowse files
🗃️ feat!: port exams domain to sqlx/PostgresAhmet Kaan Gümüş · 381e16c
🗃️ feat!: port exams domain to sqlx/Postgres
- db/{exam,exam_question,exam_attempt,exam_answer,exam_result,question_image,answer_image}:
SurrealQL -> static query!/query_as! (PagedList exemption kept for
exam_question listing); composite natural PKs (exam,user,seq) everywhere;
sitting scoping via key.rs wire helpers unchanged.
- Freeze gate: write_unfrozen/IndexedResults/FROZEN_SLOT deleted; freeze is
a shared in-tx freeze_gate() (exam row FOR UPDATE + EXISTS(attempts)) run
inside each question/image write's own tx_with_retry.
- EXAM_LOCK deleted: sitting create re-judges sittable/window gates on the
locked exam row (guard_start) then claims exam_sat_total in one CTE;
exam delete locks the exam row before its ordered cascade and collects
blob keys inside the tx; answer/answer-image saves lock the exam row
ahead of their upserts (bump-and-restore touch tricks deleted).
- PRESENCE_LOCK deleted: join = unconditional left_at clear; last-out =
single conditional stamp_left_if_running (left_at IS NULL AND
finished_at IS NULL AND live-schedule in-progress); ExamPresence map
mutex stays for counts.
- Grade tx: exam row FOR UPDATE, draft gate in-tx, kind_ref claim
(retired=false), 4-counter first-vs-regrade precedence preserved exactly;
remove() refunds via data-modifying CTE.
- THROW markers -> early returns: exam_redraft, questions_frozen, no_exam,
question_subject_gone, question_row_gone, question_stale_move,
exam_missing, exam_draft, kind_retired.
- cfg(test) mods left for wave 3.🗃️ feat!: port identity+auth (user, session, profile, badge, settings, builder) to sqlx/PostgresAhmet Kaan Gümüş · 29cdff2
🗃️ feat!: port identity+auth (user, session, profile, badge, settings, builder) to sqlx/Postgres - db/user: static query_as! row mint (23505 on app_user_username -> 409), PagedList listings, position()-based fold search, role cascade as ONE tx_with_retry(cascade=true) closure (admin floor = guard on the role write itself; class/enrollment counts decrement in the delete CTEs; parent-seat sweep frees unfrozen lists via DELETE..USING; board close CAS + strip with post-image fan-out rows; appointment bookings cancelled then slots deleted under the new SET NULL link); avatar writers return the FOR UPDATE pre-image - service/user: ADMIN_FLOOR_LOCK deleted (floor rides the UPDATE's WHERE), would_orphan_admins deleted; set_role keeps the 404 pre-read - service/settings: SETTINGS_LOCK, Undo/restore deleted; retire/unretire + guarded save ride ONE transaction (stale save aborts via marker and retries); retire switch = cap.rs recipe (FOR UPDATE + ON CONFLICT..WHERE count=0); messages byte-identical - db/settings: load/save/save_if_unchanged as static macros; CAS is ONE guarded upsert (INSERT arm seeds defaults, ON CONFLICT WHERE IS NOT DISTINCT FROM per column) - db/badge: counter projection off app_user *_total columns; sync keeps the runtime N-statement exemption with ON CONFLICT..WHERE earned_at IS NULL - db/profile: one-row pomodoro aggregate (COALESCE sum, negative floor) - db/session, db/builder: static macros; builder_session keys now uuid v7 - domain/badge: fields crate-visible for macro construction - db/page: Param::Texts variant for ANY() text-array binds - web/users: avatar blob name mints via next_uuid; docs de-Surrealized - cfg(test) mods left for wave 3 (service/settings tests reference the deleted lock machinery; db tests reference init_mem) SQL semantics probe-verified on a scratch Postgres: CAS arms (insert/match/ stale/NULL), admin floor (demote/refuse/promote), retire switch (insert/ in-use-refused/unchanged/idempotent unretire), cascade CTEs (counts, frozen list kept, strip post-image, close first-stamp-wins), position() fold, badge stamp idempotency.
🗃️ feat!: port courses, subjects, terms, enrollments, sessions, attendance to sqlx/PostgresAhmet Kaan Gümüş · f734c6aBrowse files
🐛 fix: board_stroke::history clause placeholders follow positional bind orderAhmet Kaan Gümüş · bc532b9Browse files
🗃️ wip(l10): port message/parent_link/attendance/registration/event/pomodoro/chatbot db+service layersAhmet Kaan Gümüş · 71525a3Browse files
🗃️ chore: drop redundant uuid imports superseded by Main's qualified signaturesAhmet Kaan Gümüş · eb3efbeBrowse files
🗃️ feat!: port boards, notes and rag to sqlx/PostgresAhmet Kaan Gümüş · c928ecf
🗃️ feat!: port boards, notes and rag to sqlx/Postgres - board/note/course_note/rag_output db layers: static query!/query_as! against the union-schema prepare DB; PagedList/FieldUpdate for the runtime builders - file caps via the cap claim CTE at each call site; board create claims app_user.board_count, delete releases it in the same tx - BOARD_ROSTER_LOCK deleted: invite is one guarded atomic-array union (coalesce(array_agg(DISTINCT unnest(participants || $n))) with a cardinality cap on the row version the UPDATE acts on) - stroke dual-counter claim: one UPDATE bumps both counters, lifetime cap + open guard + epoch in the WHERE; zero rows re-read via cap::full_kind - board clear: pre-image read under SELECT ... FOR UPDATE, refusal precedence preserved (closed > not-creator > locked > blank), guarded epoch bump, marker insert, one tx (CLEAR_REFUSED THROW now Rust-level refusals) - rag_output.payload JSONB (sqlx::types::Json), sources uuid[] cascade via $n = ANY(sources); note/course_note delete cascades sweep rag_output in-tx (real FKs refuse dangling derived rows) - board rosters: uuid[] + GIN, membership reads $n = ANY(participants) - dead SurrealQL-shaped constants removed (BOARD_OPEN_GUARD, BOARD_STROKE_TABLE, counter/file-count field constants); uuid::Uuid imports for my domain files
🗃️ feat!: port meals (menu, dishes, bookings, attendance, ledger, dietary profiles) to sqlx/PostgresAhmet Kaan Gümüş · 50719d0Browse files
🗃️ fix: restore homework_file.file column (blob name, dropped in translation)Ahmet Kaan Gümüş · 761b1fbBrowse files
🗃️ fix: qualify uuid::Uuid in accessor where the import is absentAhmet Kaan Gümüş · 3343a14Browse files
merge postgres (uuid accessor, Param::Opt*); resolve subject docAhmet Kaan Gümüş · 610b3b5Browse files