Open ivan006 opened 3 years ago
This project from the onset seems very apt/intelligent.
Thank you for your kind words.
Are there any community space for users of this system to communicate and compare notes etc?
Not that I'm aware of (other than Github issues).
Kind regards, Maurits
does this integrate with any other libraries like datatables?
does this integrate with any other libraries like datatables?
Sure, why not?
scrutiny warning
yeah but im wondering has anyone demonstrated how to do this so others can do it more easily? who uses this library and how have they used it? how has this library been useful to others? the concept sounds sensible but if its not implemented then me implementing it will take more effort. how can i get the most bang for my "buck" with this library?
Lot's of questions that I can't help you with (I don't know the answers). You may try it out and help others by publishing your findings.
If you need a user interface, then you may try: https://github.com/mevdschee/php-crud-ui
It is my take on a usable (and high performance) user interface for the API.
Kind regards, Maurits
Cool thanks. Do you mind demoing it in a youtube video? (screencastify chrome plugin can help record in case u dont know of any recording tools)
Why don't you try to run it with your own dataset? I'm here to help you out when you run into problems. Also, feel free to create a YouTube video about it.
How about just a screenshot? Its a lot of hours for me to set up libraries
Im very interested in crud generators and the like i have myself made a more dynamic crud generator that works for any table, this means you dont have to generate a new crud functionality for each table. My engine also allows for seeing records that are related to a record. E.g. here is record 2 in the commodity type table and its related items.
The key here of course is in its dynamic-ness and it uses ajax pagination so of course i have my own dynamic api in addition to the ui. But im just wanting to compare notes with others to see if i can improve my setup. Another key thing in my app is the relationship visibility as mentioned.
Im very interested in crud generators and the like i have myself made a more dynamic crud generator that works for any table
Nice, did you publish it? Can I try it out?
Yes but do u mean as an installable library? If so no its only available as a full app https://github.com/ivan006/Bg---table-page-3---free-php-spreadsheet-database-hybrid I will make a youtube video on how to set it up when i have the time thanks for ur interest. And thanks for the screenshots.
So in your app i see you can "view" a record so when u are viewing a record can u see related records? boths parents and children?
when u are viewing a record can u see related records? boths parents and children?
You can only see a link to the filtered list (of children).
Wow and that "post='blog started'" thats cool. I understand "post" refers to the table but what does "blog started" refer to is searching all columns or a specific column if its a specific column then how do u flag which column is priority?
'Post' is short for 'post_id' (a fk filter on the comments table) and 'blog started' is the default representation of a record in the related table (the value in the 'name' field)
Ok cool, and then this unfortunately contains the developer to have to create a column with the name "name". Yeah my system also has those kinds of constraints for instance the primary key has to called "id" which makes the system a bit rigid, oh well u cant win them all.
this unfortunately contains the developer to have to create a column with the name "name".
It returns the first text column, in this case 'name', see:
private function getDisplayColumn(string $table, string $action)
{
$properties = $this->getProperties($table, $action);
foreach ($properties as $field => $property) {
if ($property['type'] == 'string') {
return $field;
}
}
return false;
}
I hope this helps you in any way. Kind regards, Maurits
Yeah my system also has those kinds of constraints for instance the primary key has to called "id" which makes the system a bit rigid
I don't have that constraint. I request the primary key from the information schema (it may not be composite), see:
private function getTablePrimaryKeysSQL(): string
{
switch ($this->driver) {
case 'mysql':
return 'SELECT "COLUMN_NAME" FROM "INFORMATION_SCHEMA"."KEY_COLUMN_USAGE" WHERE "CONSTRAINT_NAME" = \'PRIMARY\' AND "TABLE_NAME" = ? AND "TABLE_SCHEMA" = ?';
case 'pgsql':
return 'SELECT a.attname AS "COLUMN_NAME" FROM pg_attribute a JOIN pg_constraint c ON (c.conrelid, c.conkey[1]) = (a.attrelid, a.attnum) JOIN pg_class pgc ON pgc.oid = a.attrelid WHERE pgc.relname = ? AND \'\' <> ? AND c.contype = \'p\'';
case 'sqlsrv':
return 'SELECT c.NAME as "COLUMN_NAME" FROM sys.key_constraints kc inner join sys.objects t on t.object_id = kc.parent_object_id INNER JOIN sys.index_columns ic ON kc.parent_object_id = ic.object_id and kc.unique_index_id = ic.index_id INNER JOIN sys.columns c ON ic.object_id = c.object_id AND ic.column_id = c.column_id WHERE kc.type = \'PK\' and t.object_id = OBJECT_ID(?) and \'\' <> ?';
case 'sqlite':
return 'SELECT "name" as "COLUMN_NAME" FROM pragma_table_info(?) WHERE "pk"=1 AND \'\' <> ?';
}
}
I hope this helps you in any way. Kind regards, Maurits
I read the database structure and make a database independent model of it first. Only to generate the API or UI from that model, not directly from the reflection results. Instead of using reflection on every request I have a cache engine that can hold the reflected information, avoiding heavy load on the database server due to many reflection queries.
my system also has those kinds of constraints
My constraints are:
Im very interested in crud generators and the like i have myself made a more dynamic crud generator that works for any table
Nice, did you publish it? Can I try it out?
As promised here it (the tutorial) finally is https://www.youtube.com/watch?v=TOyiUzKToA0&list=PLDjAbnn_RxMIwOTO-3ciB1E1UmB8MEv4u
Wow.. what a work.. I mean.. the video.. the code.. everything! Congrats and thank you for sharing.
Wow.. what a work.. I mean.. the video.. the code.. everything! Congrats and thank you for sharing.
So kind thank you
Let me know when/if u get round to installing my app or just watching the videos
This project from the onset seems very apt/intelligent. Are there any community space for users of this system to communicate and compare notes etc? I'd like to learn more and see the full potential.