Levy A. 85236f7efc
use new libsql php sdk (#54)
* refactor: use new libsql php sdk

* rename example

---------

Co-authored-by: Jamie Barton <jamie@notrab.dev>
2024-09-12 08:31:24 +01:00
..
2024-09-12 08:31:24 +01:00
2024-09-12 08:31:24 +01:00
2024-09-12 08:31:24 +01:00
2024-09-12 08:31:24 +01:00

Turso Example

This example demonstrates how to use Turso with Dumbo to build a simple CRUD API.

Running the Example

  1. Install dependencies:

    composer install
    
  2. Start the server:

    composer start
    
  3. Create a new user:

    curl -X POST http://localhost:8000/users \
      -H "Content-Type: application/json" \
      -d '{"name": "John Doe", "email": "john@example.com"}'
    
  4. Get all users:

    curl http://localhost:8000/users
    
  5. Get a specific user (replace 1 with the desired user ID):

    curl http://localhost:8000/users/1
    
  6. Update a user (replace 1 with the desired user ID):

    curl -X PUT http://localhost:8000/users/1 \
      -H "Content-Type: application/json" \
      -d '{"name": "John Updated", "email": "john.updated@example.com"}'
    
  7. Delete a user (replace 1 with the desired user ID):

    curl -X DELETE http://localhost:8000/users/1