php-crud-api
php-crud-api copied to clipboard
Create database
Thank you for your hard work!! I just have a request. Is it possible to create a database from this script? Like POST /"DATABASE NAME" ? & then create a table on that database? essentially an endpoint to dynamically creating databases & tables.
Is it possible to create a database from this script?
No, but it is not a bad idea. I'll register it as a feature request.
This might be added (at some point) to v2 as that version has more advanced meta data support.
Thanks!! That would be awesome. Right now I’m writing stored procedures with prepare statements in MySQL, & then calling them via the php-sp-api. Do you think that is a viable solution?
Everaldlee Johnson
On April 23, 2018 at 11:27:09 PM, Maurits van der Schee ( [email protected]) wrote:
Is it possible to create a database from this script?
No, but it is not a bad idea. I'll register it as a feature request.
This might be added (at some point) to v2 as that version has more advanced meta data support.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mevdschee/php-crud-api/issues/376#issuecomment-383791796, or mute the thread https://github.com/notifications/unsubscribe-auth/AUK79Bw1JsTvm0DCsvI3ZpLtbrbXCO7rks5trpuNgaJpZM4TfBmy .
Do you think that is a viable solution?
Sure it is.. :+1:
@f0rever-johnson I'm aiming for such support in v2. I have reflection, table renames and column changes implemented currently.
Hey, any update to dynamically creating databases/tables?
Hi Everaldlee, Thank you for asking this question. Creating tables is now possible, creating databases is not (yet) supported. I hope this helps you. Kind regards, Maurits
I am not seeing anything regarding creating tables. Is there an example or a specify endpoint I should be using?
You need to enable the 'columns' controller, see also: https://github.com/mevdschee/php-crud-admin/blob/main/src/index.php
I enabled the columns controller. However I am unsure on how to access the endpoint to create a table. Essentially I have a sample table(s) I would like to duplicate whenever a new user is created in my identityprovider.
I have a sample table I would like to duplicate
This is not yet supported, although one could write this as middleware, executing certain queries when a new authenticated user is encountered.