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

DB-Connected REST service should create fields automatically from DB schema #71

Open
michalbundyra opened this issue Jan 10, 2020 · 3 comments

Comments

@michalbundyra
Copy link
Member

Usually, DB-connected services are created on databases that already exist. So, the DB schema is already known and Apigility can automatically configure the DB columns as fields in the REST service. Apigility can also automatically configure some attributes of the fields, e.g. if the field is required, or create a validator that ensures an integer input, etc.

At the moment, after creating the DB-connected service, I have to edit it and add all these fields myself, which is error prone. I have to look at the DB schema and type the exact column names as field names.

This improvement will bring this RAD feature one step forward.


Originally posted by @kaloyan-raev at zfcampus/zf-apigility#37

@michalbundyra
Copy link
Member Author

I could not agree more... Hopefully, I've been working on this need and already made a PR that is to be implemented in version 1.1 in about a month.
Basically, it's called "Database Autodiscovery". You'll get an extra-tab on the REST service creation screen. After choosing your adapter, DB Autodiscovery will introspect your DB schema and generate DB-connected services as well as fields, based on column definitions. It's for now stable and just need a bit of cleaning and unit testing.
Stay tuned ;)


Originally posted by @jguittard at zfcampus/zf-apigility#37 (comment)

@michalbundyra
Copy link
Member Author

Sounds great!


Originally posted by @kaloyan-raev at zfcampus/zf-apigility#37 (comment)

@michalbundyra
Copy link
Member Author

@kaloyan-raev You can see the work @jguittard has done in zfcampus/zf-apigility-admin#179


Originally posted by @weierophinney at zfcampus/zf-apigility#37 (comment)

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

1 participant