DEV Community

MemphisNguyen
MemphisNguyen

Posted on

[Help] Multi-schema on AdonisJS

Hi there,
I'm working on project using AdonisJS and Postgres to serve for multi-tenant purpose. I want to be able to access multiple schema with 1 source code only but I couldn't find any document about it.

In basic, I will use the client ID to determine the schema that would be used to query the data from.
I can find some document about putting the schema with the table name in the model but that's not what I want because the model will be sticked to one schema only.

Have you experienced with this kind of structure and can you help me?
Thanks.

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →