FirebirdREST¶
Serve a RESTful API from any Firebird database.
FirebirdREST is a standalone web server that turns a Firebird database into a REST API, in the spirit of PostgREST. Your tables, views, stored procedures and functions become endpoints, and the grants and roles you already have in Firebird decide what each caller may do. Because the API is derived from the schema, there is no API layer to write or maintain.
$ curl 'http://localhost:3000/books?select=title,price,authors(name)&price=lt.10&order=price.desc'
[
{"title":"Guards! Guards!","price":9.99,"authors":{"name":"Terry Pratchett"}},
{"title":"Small Gods","price":8.50,"authors":{"name":"Terry Pratchett"}},
{"title":"A Wizard of Earthsea","price":7.25,"authors":{"name":"Ursula K. Le Guin"}}
]
Features¶
- One static binary for Linux, macOS, Windows and FreeBSD. It talks the Firebird wire protocol directly, so no client library is needed.
- PostgREST's URL grammar:
select, filters, logic trees, ordering and paging. - Resource embedding through foreign keys: many-to-one, one-to-many,
many-to-many, nested,
!innerand spread (...rel(cols)). - Aggregates:
count(),sum(),avg(),min(),max(). - Computed fields and relationships from functions and procedures.
- Writes: bulk inserts, upserts,
PATCH,PUTandDELETE, returning the written rows on request. - Stored procedures and functions, including routines in packages.
- Security through Firebird roles: a JWT's
roleclaim selects the FirebirdROLE, and claims can be read in PSQL for row-level rules. - OpenAPI 3 description at
/, CSV output, health endpoints, schema reload onPOST_EVENT. - Realtime events: Firebird
POST_EVENTs streamed to clients as Server-Sent Events, something PostgREST does not have. - Firebird 3, 4 and 5, all tested in CI, plus early testing against the Firebird 6 snapshot.
- SQL schemas on Firebird 6 (experimental), chosen per request with
Accept-ProfileandContent-Profile.
Where to start¶
- Getting started: run the example database with Docker and make your first requests in five minutes.
- Authentication: add a JWT and see grants decide what each role can see.
- API reference: everything a URL can say.
- Configuration: every setting.
Install¶
Download an archive for your platform from the releases page, for example: