Skip to content

Add db commands to the CLI for database management#5592

Merged
StachuDotNet merged 2 commits intodarklang:mainfrom
OceanOak:db-commands
Feb 17, 2026
Merged

Add db commands to the CLI for database management#5592
StachuDotNet merged 2 commits intodarklang:mainfrom
OceanOak:db-commands

Conversation

@OceanOak
Copy link
Copy Markdown
Collaborator

@OceanOak OceanOak commented Jan 29, 2026

This PR:

  • Add db CLI command for creating and managing user databases
  • Re-introduce accounts table and add account_id to canvases, so each account gets its own canvas and DBs

Test example:

DARK_ACCOUNT=Darklang ./scripts/run-cli type Darklang.Test.User '{ name: String; email: String; age: Int64 }'
✓ Created type: Darklang.Test.User

DARK_ACCOUNT=Darklang ./scripts/run-cli db Users Darklang.Test.User
Created database: Users (type: Darklang.Test.User)

DARK_ACCOUNT=Darklang ./scripts/run-cli db set Users alice '{ name = "Alice"; email = "alice@example.com"; age = 30L }'
Set alice in Users

DARK_ACCOUNT=Darklang ./scripts/run-cli db set Users john '{ name = "John"; email = "john@examp
le.com"; age = 25L }'
Set john in Users

DARK_ACCOUNT=Darklang ./scripts/run-cli db view Users

Key            name           email          age            
──────────────────────────────────────────────
alice          "Alice"        "alice@example.com"30             
john           "John"         "john@examp"   25             

2 row(s)

@OceanOak OceanOak changed the title WIP: Add db commands to the cli Add db commands to the CLI Jan 30, 2026
@OceanOak OceanOak changed the title Add db commands to the CLI Add db commands to the CLI for database management Jan 30, 2026
@OceanOak OceanOak marked this pull request as ready for review February 2, 2026 10:14
@OceanOak OceanOak marked this pull request as draft February 2, 2026 20:02
@OceanOak OceanOak marked this pull request as ready for review February 14, 2026 20:31
Copy link
Copy Markdown
Member

@StachuDotNet StachuDotNet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on this.

Comment thread backend/src/BuiltinExecution/Libs/NoModule.fs
@StachuDotNet StachuDotNet merged commit 8b3779e into darklang:main Feb 17, 2026
2 of 4 checks passed
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.

2 participants