-
Notifications
You must be signed in to change notification settings - Fork 22
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
Support for MySQL views #67
Comments
What is the primary key (or some other unique key) on the The relationship support will start out with being able to select foreign keys from a dropdown list. As the editor learns how to handle more complex data structures, then yes, I'd like to be able to indicate that related data should be edited from the parent table (and then completely ignore the child table). |
|
Okay. The Setting |
Hi there. I have an existing MySQL+Perl command-line app with a complex schema with many relationships (some of the queries have up to 10 JOINs). Roughly speaking, everything the user sees comes from an SQL view rather than the underlying table, and the logic in the code manipulates the tables. I have recently decided to redevelop my app into something web-based (because the CLI app is somewhat hostile) and wish to use Mojolicious+Yancy. I'm OK at Perl and SQL but completely new to web development.
However, Yancy seems to break when I specify an SQL view in the schema definition, such as in this example where
CAMERA
is a table andchoose_camera
is a view that joinsCAMERA
to other tables and makes a pretty list that can be displayed to the user verbatim.Running with that schema throws the following error:
I've set
x-id-field
as suggested but still no luck, so I guess that means Yancy can't understand SQL views?I also note in #25 that you're planning relationship support for v2. I think this will go a long way towards solving my problem by avoiding the use of views by modelling the relationships directly, hopefully displaying the tables with the related columns filled in, and also providing some kind of lookup feature when adding new records?
Is what I am trying to achieve too complex for Yancy alone, and should I drop the idea of trying to use the Yancy editor and instead set up my own Mojolicious routes/controllers with Yancy helpers? I'm a bit hesitant before going down this path as I will presumably have to reinvent quite a few wheels along the way.
Thanks,
Jonathan
The text was updated successfully, but these errors were encountered: