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

Best way to interact with database with cv? #20

Closed
herbdool opened this issue Apr 13, 2017 · 3 comments
Closed

Best way to interact with database with cv? #20

herbdool opened this issue Apr 13, 2017 · 3 comments

Comments

@herbdool
Copy link

It appears that so far it might mean using the cv cli--not sure how. Are there plans to implement sql commands in cv? Like cv sql-dump, cv sql-query, cv sql-connect and so on?

Thanks for the useful tool!

@totten
Copy link
Member

totten commented Feb 22, 2018

@herbdool Thanks for the comment; apologies for not spotting it before.

Right, cv cli is a REPL for running PHP. For SQL, we'd have to do another subcommand. FWIW, I haven't needed it because I usually have drush or amp. However, one could port over these commands:

The main change -- instead of using the instances service to locate a data source, one could use CIVICRM_DSN and CIVICRM_UF_DSN.

@totten
Copy link
Member

totten commented May 26, 2022

It should be noted that a cv sql command was subsequently ported. It's generally the same as the amp sql command. It can be used for either:

  • Launching the interactive mysql cli
  • Piping in SQL statements (and including dynamic data, eg @ENV[USERNAME] or #ENV[USERID])

I think there could value in introducing more commands (eg backup/restore), but we should probably separate issues for those.

@totten totten closed this as completed May 26, 2022
@herbdool
Copy link
Author

Thanks @totten. I saw this issue in the backlog #73 which I think is about the backup / sql dump command. Can continue on that one.

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

No branches or pull requests

2 participants