Everything is a Resource. And Everything has a CRUD API
With Data handler, you can create CRUD APIs for your data in a few minutes
country.yml
type: resource
name: country
properties:
- name: name # name of the property
type: STRING # type of the property
length: 255
required: true
unique: true
- name: description # name of the property
type: STRING # type of the property
length: 255
dhctl apply -f country.yml
So you are ready, you have fully established Rest API for country resource
axios.post('http://localhost:9009/country', {
name: 'Country1',
description: 'Sample Country 1'
})
You can build entire application with resources and references between them (like relations in relational databases)
Everything can be written by resources, not? Let's extend our country resource
countryExtension.onCreate(async (country) => {
country.description = country.description + ' - Extended'
return country
})
So we have extended our country resource with modification description on create
So, with data handler, you can create your application with resources and you can customize behavior of your resources with extensions
Data Handler is a Low Code software that allows to create various Grpc and Rest APIs from various database platforms
dhctl
country.yml
type: resource
name: country
properties:
- name: name
type: STRING
length: 255
required: true
unique: true
- name: description
type: STRING
length: 255
dhctl apply -f country.hcl
Swagger: http://localhost:9009/docs/index.html
# Create Country
curl -X POST --location "http://localhost:9009/country" \
-H "Authorization: <token>" \
-d "{
\"name\": \"Country1\",
\"description\": \"Sample Country 1\"
}"
# List Countries
curl "http://localhost:9009/country" -H "Authorization: <token>"
Let's run application on standalone mode:
docker run -d -p 9009:9009 -v ${PWD}/data:/var/lib/postgresql/data tislib/data-handler:full-latest
Let's install our client dhctl
You can download client binary from release page https://github.com/tislib/data-handler/releases/latest (download dhctl-OS-ARCH)
You can also use go install if you have go runtime on your local
go install github.com/tislib/data-handler/cmd/dhctl@latest
Now let's configure our client to point to server
mkdir -p ~/.dhctl
nano ~/.dhctl/config
Paste config to there
type: server
servers:
- name: local
host: 127.0.0.1:9009
authentication:
username: admin
password: admin
defaultServer: local
Now we are ready.
Content type
Image
Digest
sha256:faab0a9e1…
Size
141.8 MB
Last updated
over 3 years ago
docker pull tislib/data-handler