Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow seeding databases with content from existing group databases #626

Merged
merged 3 commits into from
Sep 13, 2023

Conversation

athoscouto
Copy link
Collaborator

@athoscouto athoscouto commented Sep 12, 2023

Adds the --from-db flag to the turso db create command.

Example:

turso db create new-db --from-db base-db

This will create a new database called new-db with schema and data copied from base-db.


Caveats:

  • It will only work if base-db is a group database.
$ turso db create new-db --from-db non-group-db
Error: could not create database new-db: forked database 'non-group-db' must belong to a group
  • It works with the --group $GROUP flag, but base-db must be inside $GROUP.
> turso db create new-db --from-db base-db --group group2
Error: could not create database new-db: can only fork databases within the same group: database base-db is not part of group group2

@athoscouto athoscouto temporarily deployed to internal September 12, 2023 15:55 — with GitHub Actions Inactive
@athoscouto athoscouto temporarily deployed to internal September 13, 2023 15:38 — with GitHub Actions Inactive
@athoscouto athoscouto requested a review from gris September 13, 2023 15:39
@athoscouto athoscouto changed the title Allow forking databases group databases Allow forking group databases Sep 13, 2023
@athoscouto athoscouto changed the title Allow forking group databases Allow seeding databases with content from existing group databases Sep 13, 2023
@athoscouto athoscouto merged commit a849bb8 into main Sep 13, 2023
2 checks passed
@athoscouto athoscouto deleted the feat/fork branch September 13, 2023 16:30
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