Releases: encoredev/encore
v1.46.20 — Improvements and Fixes
This release fixes a bug in Encore.go where traces for outbox initiated pubsub messages would not be recorded.
v1.46.19
What's Changed
- fix/make RPC functions and parameters accessible in generated Go client by @janceesvansenden in #1861
- Update compliance.md by @marcuskohlberg in #1875
- clientgen: Add option to add auth handler to an existing client by @ekerfelt in #1863
New Contributors
- @janceesvansenden made their first contribution in #1861
Full Changelog: v1.46.18...v1.46.19
v1.46.18
What's Changed
- docs/ts: passing data from middlewares by @fredr in #1860
- database transaction support in typescript by @fredr in #1847
- ts/docs: add bun experiment to faq by @fredr in #1862
- Fix child trace sampling bug by @ekerfelt in #1864
- Fix TraceParent parsing by @ekerfelt in #1865
- add port config to cli docs by @marcuskohlberg in #1870
- Bump clientgen timeout to 30s by @ekerfelt in #1872
Full Changelog: v1.46.17...v1.46.18
v1.46.17 — Improvements and Fixes
What's Changed
- runtimes/core: add support for converting to sql enum by @fredr in #1848
- fix new clippy lints by @fredr in #1850
- tracer: Add err log when parsing invalid trace header by @ekerfelt in #1851
- runtimes/core: support PValue::DateTime in date columns by @eandre in #1853
- add docs for exec cli by @fredr in #1849
- bugfix: remove accidental recursive accepts call by @fredr in #1856
- fix correct accepts by @fredr in #1858
- pkg/clientgen: properly encode times in query strings by @eandre in #1854
- Fix infra config pubsub bug by @ekerfelt in #1857
- db: Fix panic caused by < -1 latest schema_migration version by @ekerfelt in #1859
Full Changelog: v1.46.16...v1.46.17
v1.46.16 — Improvements
Exec command
With this release there is an exec cli command that can be used to execute scripts with the Encore app environment set up.
For TypeScript apps this can be used to run commands:
encore exec -- npx tsx ./seed.ts
For Go apps this can be used to run go scrips:
encore exec cmd/seed
What's Changed
- js/sqldb: support more array types by @fredr in #1845
- add an exec command for running scripts with inited js runtime by @fredr in #1822
Full Changelog: v1.46.15...v1.46.16
v1.46.15 — Improvements
What's Changed
- runtimes/js: fix api.static docs by @eandre in #1838
- runtimes/{core,js}: add support for integer arrays in sqldb by @fredr in #1841
- fix encoding of undefined for sql queries by @eandre in #1842
- clientgen: Add support for parsing dates in TS response types by @ekerfelt in #1844
Full Changelog: v1.46.14...v1.46.15
v1.46.14 — Improvements
What's Changed
- [errs] use errors.As instead of type assertions by @twindebank in #1808
- docs/ts: document the new raw sql methods by @fredr in #1833
- pkg/cueutil: close files by @eandre in #1834
- runtimes/{core,js}: add hosted services to app meta by @fredr in #1832
- runtimes/{core,js}: add support for query string arrays by @fredr in #1835
- runtimes/js: add new raw sql method for connection by @fredr in #1836
Thanks to our new contributor ❤️
- @twindebank made their first contribution in #1808
Full Changelog: v1.46.13...v1.46.14
v1.46.13 — Fix `encore build docker` on windows
What's Changed
Full Changelog: v1.46.12...v1.46.13
v1.46.12 — Fixes and Improvements
What's Changed
- runtimes/{core,js}: make static not found status code configurable by @fredr in #1823
- fix: override not found status after fallback by @fredr in #1825
- builder: make Stderr configurable by @eandre in #1656
- fix resolution of nested imports by @fredr in #1826
- add support for keyof enum pattern by @fredr in #1828
Full Changelog: v1.46.11...v1.46.12
v1.46.11 — Raw sql query methods in encore.ts
Encore.ts now supports using raw sql query methods, this means you can more easily implement advanced queries.
Querying data
To query data, use the following methods:
db.query
: Returns an asynchronous iterator, yielding rows one by one.db.queryRow
: Returns a single row, ornull
if no rows are found.db.queryAll
: Returns an array of all rows.db.rawQuery
: Similar todb.query
, but takes a raw SQL string and parameters.db.rawQueryRow
: Similar todb.queryRow
, but takes a raw SQL string and parameters.db.rawQueryAll
: Similar todb.queryAll
, but takes a raw SQL string and parameters.
Typical usage looks like this:
const allTodos = await db.query`SELECT * FROM todo_item`;
for await (const todo of allTodos) {
// Process each todo
}
Or to query a single todo item by id:
async function getTodoTitle(id: number): string | undefined {
const row = await db.queryRow`SELECT title FROM todo_item WHERE id = ${id}`;
return row?.title;
}
Or to query using raw SQL and parameters:
async function getTodoTitle(id: number): string | undefined {
const row = await db.rawQueryRow("SELECT title FROM todo_item WHERE id = $1", id);
return row?.title;
}
Inserting data
To insert data, or to make database queries that don't return any rows, use db.exec
or db.rawExec
.
For example:
await db.exec`
INSERT INTO todo_item (title, done)
VALUES (${title}, false)
`;
Or using raw SQL and parameters:
await db.rawExec(
"INSERT INTO todo_item (title, done) VALUES ($1, $2)",
title,
false
);
Learn more in the database docs
Full Changelog: v1.46.10...v1.46.11