Share
Embed
Transcript
19 slides
-
Who we are? Felipe Paes de Oliveira Tech Lead at
Nuveo Database Specialist at Timbira Fabrízio de Royes Mello -
Agenda • Why pREST born? • Why do not use
Postgrest? • How to use pREST? • What are the pros and cons of pREST in a Software Engineer vision? • What are the pros and cons of pREST in a Database Specialist vision? • What have on the pREST roadmap? -
About pREST • Born at Nuveo; • Written in Go;
• Nuveo Core V2 and others projects starting in parallel; • To optimize time in some basic features creation that involves just to interact database. -
Why pREST born? • Born at Nuveo; • Written in
Go; • Nuveo Core V2 and others projects starting in parallel; • To optimize time in some basic features creation that involves just to interact database. -
Why do not use Postgrest? • Postgrest: https://postgrest.org • Postgrest
is written in Haskell • Difficult to Hire • 1 Dev at Nuveo knows about Haskell -
Features • CRUD • Where • Join • Group By
• Like • JSONB • Permission • Scripts • Migration • More in https://postgres.rest -
CRUD /DATABASE/SCHEMA/TABLE GET - Select POST - Insert DELETE -
Delete PUT/PATCH - Update -
Scripts • GET /_QUERIES/foo/some_get?field1=bar • POST /_QUERIES/foo/some_create?field1=bar • PUT/PATCH /_QUERIES/foo/some_update?field1=bar
• DELETE /_QUERIES/foo/some_delete?field1=bar -
Scripts queries/ └── foo/ └── some_get.read.sql └── some_create.write.sql └── some_update.update.sql
└── some_delete.delete.sql -
Tables Permission [access] restrict = true # can access only
the tables listed below [[access.tables]] name = "test" permissions = ["read", "write", "delete"] fields = ["id", "name"] [[access.tables]] name = "testarray" permissions = ["read", "write", "delete"] fields = ["id", "data"] -
Migration prest migrate --url driver://url --path ./migrations create migration_file_xyz prest
migrate --url driver://url --path ./migrations up prest migrate --url driver://url --path ./migrations down prest migrate --url driver://url --path ./migrations redo prest migrate --url driver://url --path ./migrations reset prest migrate --url driver://url --path ./migrations version prest migrate --url driver://url --path ./migrations next +1 prest migrate --url driver://url --path ./migrations next +2 prest migrate --url driver://url --path ./migrations next -n prest migrate --url driver://url --path ./migrations goto 1 prest migrate --url driver://url --path ./migrations goto 10 prest migrate --url driver://url --path ./migrations goto v -
What is next? • Transaction support • Rewrite the CLI
to make more user friendly • Background Worker??? -
More Info • Docs: http://postgres.rest • Issues: https://github.com/prest/prest/issues • Source
code: https://github.com/prest