Comments (8)
Topper!
from php-crud-api.
Hi Raymond, Thank you for your great question.
If not do you have a suggestion how to deal with this?
Every record should have a synthetic primary key (auto increment or uuid). You can find the primary key using filters. Updates should go on primary keys not on filters.
SELECT id FROM posts WHERE ...
UPDATE posts SET ... WHERE id = ?
I hope you understand this very minimal explanation. Kind regards, Maurits
from php-crud-api.
Hi Raymond,
To answer your specific questions:
Is this possible using the php-crud-api?
No, it is not.
If not do you have a suggestion how to deal with this?
Do multiple http requests.
Kind regards, Maurits
from php-crud-api.
Hi Maurits,
Thank you for your suggestions. During the last 2 weeks I have implemented the whole system, and soon it will arrive online.
Reading is easy of course.
The update function needs already to be done via separate api calls one at a time using the already known record id.
Creating and deleting records I did via an "await-loop" which worked fine.
Just this morning I came across the Batch operations, and I already implemented the delete colums-rows-pages already using that very efficient functionality!
One question remains, about creating records in batch. How should I provice the IDs in the url? The IDs are normally not given when creating a record as these are generated in the database itself.
Maybe you can put an example in the docs?
Kind regards,
Raymond
from php-crud-api.
Hi Raymond,
I hope you are aware of the "Batch Operations" section in the manual. You can find various useful examples there including batch creation of records.
see: https://github.com/mevdschee/php-crud-api?tab=readme-ov-file#batch-operations
Batch insert is shown in the tests:
Kind regards,
Maurits
from php-crud-api.
I am aware, this morning I came across that part in the docs. However I don't see a CREATE batch example...
from php-crud-api.
The solution is simple, just post the objects and do not use a key :)
Thanks @mevdschee for this beautiful single file api 👍
from php-crud-api.
Thank you for your kind words. I updated the README to include this information, see: c38083f
from php-crud-api.
Related Issues (20)
- firebase jwt public key rotation HOT 5
- "Route '' not found" HOT 3
- Additional SQL queries in authorization handlers HOT 2
- Direct usage of PHP CRUD API functions in external PHP Files HOT 8
- Failure on postgres when table name is domains HOT 10
- Returning user uploaded file using custom controller HOT 2
- Found this PDOException occurred (enable debug mode) in message HOT 6
- Route Not Found Error Upon Deployment to Online Server HOT 4
- Authentication to see documentation HOT 2
- Error code :1000, message : Route not found HOT 2
- Clean way to prevent TypeConverter from casting values from TINYINT column into booleans HOT 3
- Sharing Session with Codeigniter app on same domain. HOT 5
- How to use UUID as primary key and return it HOT 2
- Share links to your custom controllers HOT 4
- Filters Search Failing With Underscore (_) HOT 2
- Usage question - how to get number of records of very large dataset HOT 4
- SQLSTATE[HY000]: General error: 1 near \"(\": syntax error [New Versions] HOT 1
- multi tenancy HOT 1
- MariaDB/MySQL Binary->Bit data type not supported HOT 1
- SQL Server tables with triggers defined throw an error HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-crud-api.