Skip to content

Releases: encoredev/encore

v1.46.20 — Improvements and Fixes

22 Apr 11:38
4a17552
Compare
Choose a tag to compare

This release fixes a bug in Encore.go where traces for outbox initiated pubsub messages would not be recorded.

v1.46.19

22 Apr 11:40
c017e87
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.46.18...v1.46.19

v1.46.18

22 Apr 11:40
b22a313
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.46.17...v1.46.18

v1.46.17 — Improvements and Fixes

09 Apr 07:31
c7994e2
Compare
Choose a tag to compare

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

01 Apr 15:28
142a05f
Compare
Choose a tag to compare

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

01 Apr 14:54
0a4f184
Compare
Choose a tag to compare

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

27 Mar 11:16
db3df50
Compare
Choose a tag to compare

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 ❤️

Full Changelog: v1.46.13...v1.46.14

v1.46.13 — Fix `encore build docker` on windows

24 Mar 15:39
5c78ff0
Compare
Choose a tag to compare

What's Changed

  • Fix encore build docker on windows by @fredr in #1831

Full Changelog: v1.46.12...v1.46.13

v1.46.12 — Fixes and Improvements

21 Mar 14:48
1947f5e
Compare
Choose a tag to compare

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

21 Mar 14:24
f12095c
Compare
Choose a tag to compare

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, or null if no rows are found.
  • db.queryAll: Returns an array of all rows.
  • db.rawQuery: Similar to db.query, but takes a raw SQL string and parameters.
  • db.rawQueryRow: Similar to db.queryRow, but takes a raw SQL string and parameters.
  • db.rawQueryAll: Similar to db.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