nitrictech / roadmap

Nitric Roadmap
https://nitric.io
5 stars 0 forks source link

Relational database support #30

Open jyecusch opened 10 months ago

jyecusch commented 10 months ago

Support deployment of Relational SQL databases in Nitric apps. Initial support will focus on Postgres databases.

chimon2000 commented 10 months ago

Would this integration also have a mechanism for migrations?

tjholm commented 6 months ago

Current preview implementation for AWS available at: https://github.com/nitrictech/nitric/pull/613

@chimon2000 This does include a migration mechanism at the moment. This comes in two flavors.

  1. Simple migrations directory, this can be specified as part of your IfC database definition:
import { sql } from "@nitric/sdk";

const myDatabase = sql("my-db", {
  // Use a migrations folder relative to the nitric.yaml
  migrations: "file:///migrations/"
});
  1. Custom dockerfile, this will allow the use of existing migration tooling, that may come as part of an existing ORM that is being used (e.g. Prisma/Drizzle etc)
import { sql } from "@nitric/sdk";

const myDatabase = sql("my-db", {
  // Use a dockerfile relative to the nitric.yaml
  migrations: "dockerfile:///migrations.dockerfile"
});
chimon2000 commented 6 months ago
migrations

In the case of Option 1, how would Nitric use the migrations folder?

tjholm commented 5 months ago

@chimon2000 apologies for the late reply. The migrations folder uses https://github.com/golang-migrate/migrate by default in our preview release, we'll build a default migration image in the case where a migrations directory is given using that tool.