Closed Synicix closed 3 years ago
@Synicix Pushed the last commit that will complete the resource naming changes on the pharus
side in datajoint/pharus#99. Still need to clean up things, update tests, and update docs but the interface should be locked in. Would you review each endpoint and update things here to match? Notable changes since we met are:
/get_table_attributes
and /get_table_definition
-> GET /attribute
lowerUpperUpper
@Synicix Pushed the last commit that will complete the resource naming changes on the
pharus
side in datajoint/pharus#99. Still need to clean up things, update tests, and update docs but the interface should be locked in. Would you review each endpoint and update things here to match? Notable changes since we met are:
- Consolidated
/get_table_attributes
and/get_table_definition
-> GET/attribute
- Update the naming of the keys in returned objects to follow typical naming convention e.g.
lowerUpperUpper
cool
@Synicix I have just pushed an update that addresses the new API design we discussed. The discussed design was:
- /version: GET=API version
- /login: POST=generate access token
- /schema: GET=list scheams, POST=create schema
- {schemaName}: GET=verify exists and available methods, PATCH=rename schema, DELETE=drop schema
- /table: GET=list tables, POST=create table
- {tableName}: GET=verify exists and available methods, PATCH=rename table, DELETE=drop table
- /attribute: GET=list parsed attributes, PATCH=alter table attributes
- /definition: GET=get table definition
- /record: GET=list records (paging, restriction), POST=insert many records, PATCH=update many records, DELETE=delete many records (restriction)
- /dependency: GET=list child records (restriction)
Aside from the above, also note:
insert
and update
now handle multiple values so it expects an array. Example payload:
{
"records": [
{
"computer_id": "ffffffff-86d5-4af7-a013-89bde75528bd",
"computer_serial": "ZYXWVEISJ",
"computer_brand": "HP",
"computer_built": "2021-01-01",
"computer_processor": 2.7,
"computer_memory": 32,
"computer_weight": 3.7,
"computer_cost": 599.99,
"computer_preowned": 0,
"computer_purchased": "2021-02-01 13:00:00",
"computer_updates": 0
}
]
}
delete
now accepts a restriction
exactly the same as fetch
i.e. using filters. This now allows it to delete multiple records if required but we'll just need to be extra careful on the frontend side to send only the primary key values for the specific single record selection to delete. Depends on https://github.com/datajoint/pharus/pull/100 now
@Synicix Now merging datajoint/pharus#100, we should update the submodule ref to match.
Submodule should be updated now
Depends on Pharus getting updated to the newest version. Please wait for the git submodule reference to be updated.