简体   繁体   中英

Adonis JS 5 Model Different Connection

I use AdonisJS v5 and I use multiple databases in my service. Can I set the connection on the model, without Database.manager?

I don't think you can. You have to define your connections in the database config file and then define the connection in the model

 public static connection = 'DB_USERS'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM