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

Support ORMs (Prisma, Drizzle ect.) #15

Open
arvinxx opened this issue Feb 26, 2024 · 13 comments
Open

Support ORMs (Prisma, Drizzle ect.) #15

arvinxx opened this issue Feb 26, 2024 · 13 comments

Comments

@arvinxx
Copy link

arvinxx commented Feb 26, 2024

No description provided.

@samwillis
Copy link
Collaborator

do it support prisma?

Not yet, we will be able to explore ORM support once we have #17 parameterized queries

@samwillis samwillis changed the title do it support prisma? Support ORMs (Prisma, Drizzle ect.) Feb 27, 2024
@alexgleason
Copy link

After #17 I will create a custom adapter for this with Kysely to play around with it.

@kzlar
Copy link

kzlar commented Mar 13, 2024

Also mentioned this on #8 but it would be awesome if pglite could support postgraphile ORM, I have a PoC that fails due to missing tables that are needed for introspection that I can share if there's interest.

@intellix
Copy link

intellix commented Apr 8, 2024

would like to add a vote for sequelize. Not sure if there's anything ORM specific or if it would basically be an engine swap

@amerryma
Copy link

amerryma commented Apr 8, 2024

Also mentioned this on #8 but it would be awesome if pglite could support postgraphile ORM, I have a PoC that fails due to missing tables that are needed for introspection that I can share if there's interest.

Curious how are you using postgraphile with pglite?

@sledorze
Copy link

After #17 I will create a custom adapter for this with Kysely to play around with it.

out of curiosity, have you started on it ? (no pressure, this is OSS :) )

@kzlar
Copy link

kzlar commented Apr 13, 2024

Also mentioned this on #8 but it would be awesome if pglite could support postgraphile ORM, I have a PoC that fails due to missing tables that are needed for introspection that I can share if there's interest.

Curious how are you using postgraphile with pglite?

I posted my PoC over on postgraphile's discord:
https://discord.com/channels/489127045289476126/551374822521831424/1223313956668571758
The idea is to eventually have complete e2e testing with a single process - so no need to set up a postgres server that you need to set up and tear down for every test. Still a long way to go though :)

@lastmjs
Copy link

lastmjs commented Apr 29, 2024

Just an FYI I would like to see support for the following:

  • Kysely
  • Drizzle
  • TypeORM
  • Prisma

@lastmjs
Copy link

lastmjs commented Apr 29, 2024

What special work needs to be done to support these? I was hoping the API/interface was pretty basic and generic

@sledorze
Copy link

Context: we wanted to use PGLite to speed up our unit tests with an in memory version.

As a feedback to save time for people trying the same :

  • We had a problem with the single process nature (no isolation between Txs) - I understand why, docs are crystal clear, it's by design.
  • We had a problem with startup time and RAM consumption - because of test isolation as the runner creates as much in memory instances as files make necessary - this is logical and also by design

This is not a criticism against PGLite; those are the problems all other solutions based on the same usage of bringing 'native' PG in the runtime will have.

Beside that: Great library, thanks for all efforts !

@samwillis
Copy link
Collaborator

@lastmjs Drizzle now supports PGlite as of a couple week ago. I should have updated here!

For the others, PGlite should have everything needed to build adapters/plugins for them. I'm not sure we are going to do this ourselves due to a long list of core PGlite stuff to do first. I'm very happy to do any testing or bug fixes to help out with building extensions.

For the Drizzle support they did the majority of the work and then I did a pass over it once they had tests running to fix any failures (at the time mostly our side). I am more than happy to do the same again!

@samwillis
Copy link
Collaborator

@sledorze we have a few ideas around how to improve memory usage and startup time for unit/integration testing.

What I would love to do is create a method to fork an in memory PGlite with copy-on-write of the VFS (and maybe the heap+stack, but I suspect that's hard). You could then create the database and load any data once, but then create a clean fork for each test. This should be super quick with relatively low memory usage per fork. It's not on the roadmap currently, but I hope we can look at it at some point.

@xeoshow
Copy link

xeoshow commented May 18, 2024

Hi @lastmjs ,

Is it possible to support Parse Server? Since it supports the stardard pgsql. Thanks very much.
https://github.com/parse-community/parse-server

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

9 participants