Skip to content

[AGE-2882] Add artifact DB stores - #1442

Open
rutvij-menavlikar wants to merge 10 commits into
rutvij/age-2882_1from
rutvij/age-2882_2
Open

rutvij-menavlikar wants to merge 10 commits into
rutvij/age-2882_1from
rutvij/age-2882_2

Conversation

@rutvij-menavlikar

@rutvij-menavlikar rutvij-menavlikar commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Stacked on #1435. Adds IArtifactStore with Postgres and SQLite implementations. Not wired into main.ts yet; the list/get APIs PR does that.

Linear: AGE-2882

Changes

  • src/db/artifactStore.ts: records, inputs, ArtifactSlugConflictError, IArtifactStore.
  • createArtifact / getArtifact (by tenant + slug).
  • listArtifacts: creator-scoped, most recently updated first, offset page tokens; served by artifact_list_idx from [AGE-2882] Add artifact metadata tables #1435.
  • createVersion: allocates the next version as pending. Storage keys include the version number, so file rows are written at commit.
  • commitVersion: records uploaded files, flips pending → committed, advances latest_version monotonically, in one transaction.
  • failVersion: flips pending → failed.
  • getVersion: version + files; checks the artifact is in the tenant first.
  • Kysely table types for both dialects. Changeset .changeset/artifact-store-tables.md is shared with [AGE-2882] Add artifact metadata tables #1435.

How was this tested?

  • Shared contract suite (tests/db/artifactStoreContractSuite.ts), 5 tests: SQLite and Postgres (local container) pass.
  • tsc --noEmit (src + tests/db), eslint, prettier on changed files.

Checklist

Made with Cursor


Note

Low Risk
New isolated persistence layer with contract tests; no runtime wiring or API surface changes in this PR.

Reviewed by Cursor Bugbot for commit 161a607. Bugbot is set up for automated code reviews on this repo. Configure here.

@datadog-official

datadog-official Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Code Quality  Code Vulnerabilities  IaC  Library Vulnerabilities  Secrets

🎉 All green!

🛠️ No new code quality issues
🛡️ No new code vulnerabilities
📚 No new vulnerable libraries detected
🧱 No new Infrastructure as Code (IaC) issues
🔑 No new secrets detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 161a607 | Docs | Give us feedback!

rutvij-menavlikar and others added 9 commits November 19, 2026 22:05
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant