Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike: How might we support databases #267

Open
sawyerh opened this issue Dec 13, 2023 · 1 comment
Open

Spike: How might we support databases #267

sawyerh opened this issue Dec 13, 2023 · 1 comment
Milestone

Comments

@sawyerh
Copy link
Contributor

sawyerh commented Dec 13, 2023

What's the task?

The Next.js template doesn't currently provide any out-of-the-box database support like the Flask template. There's no reason a project couldn't use the Next.js app exclusively though, and there's been at least one instance where we've had to figure out Next.js template DB support at a project level.

The template should provide similar DB support as the Flask template, such as an ORM and DB migrations.

Prior art

The "Flex" initiative used Prisma with the Next.js template. The team ran into several pain points with Prisma, so it may not be the right solution, but there could be aspects that can serve as a useful reference for this ticket. Here are some potential relevant parts:

@sawyerh sawyerh added this to the Database milestone Dec 13, 2023
@sawyerh sawyerh changed the title Support databases Spike: Recommend a database library for this template Dec 13, 2023
@sawyerh sawyerh changed the title Spike: Recommend a database library for this template Spike: How might we support a databases Dec 13, 2023
@sawyerh sawyerh changed the title Spike: How might we support a databases Spike: How might we support databases Dec 13, 2023
@jcq
Copy link
Contributor

jcq commented Dec 14, 2023

We'd need to dive in a bit more to see if it can help with the above-mentioned pain points, but I wanted to note that we should look at Drizzle ORM. I haven't yet used it myself, but everyone (online) that I have heard talk about it has said good things. Unlike the Prisma-specific schema declarations, everything is specified in TS code.

It supports a "query" syntax that is abstracted at the same level of what one would do in Prisma, but also supports an "Select" syntax where TS commands more closely resemble SQL queries for cases where performance tuning or other consideration might be helpful.

On a side note, I appreciate the cheekiness of their site. For instance, their pricing page. 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants