Files
cherrypy_sqlite_restapi/README.md
Milan Toman b018b30b79 New gitea
2021-01-20 14:40:22 +01:00

46 lines
1.5 KiB
Markdown

# cherrypy_sqlite_restapi
Simple, lightweight, universal SQLite API, based on cherrypy.
## Requirements:
1. universal
2. ssl / non-ssl versions
3. secure / cleanup of querries
4. DB/table specification
5. row inserts
6. row deletes
7. row modifies
-------------------------------------------------------------------------------
## REST API
https://www.restapitutorial.com/
## Cherrypy http microframework / server
https://cherrypy.org/
## Progress
1. set up Cherrypy server as base for RESTAPI (matoumi)
- cherrypy base, config, root, ssl (later)?
- responses for /insert /select /delete /modify
2. classes and functions for DB operations and mapping
- Conditions operators and values can obviously be merged to one statement
and sent to the API as is - then need to be validated.
- INSERT
- **STRUCTURE** http://server/{operation}/{db}/{table}/?values=1,2,3,4
- INSERT INTO {table} VALUES({val1}, {val2})
- validate number of fields and types
- error handling and tracebacks
- SELECT
- **STRUCTURE:** http://server/{operation}/{db}/{table}/?json=true
- operation, db, table, json are optional
- SELECT {fields} FROM {table} WHERE {condition} {operator} {value}
- TODO: conditions and filters
- the whole where cluase is optional, but needs to be implemented
- DELETE
- DELETE FROM {table} WHERE {condition} {operator} {value}
- MODIFY / ALTER
3. aggregate functions and complex queries mapping