Working With Multiple Databases

Resquel connects to one database, the one named in settings.resquel.db.database. Routes can still read from other databases on the same server by naming them in full in the query.

Query another database on the same server

JSON
"routes": [
  {
    "method": "get",
    "endpoint": "/departments",
    "query": "SELECT DeptCode, DeptName FROM Departments;"
  },
  {
    "method": "get",
    "endpoint": "/regions",
    "query": "SELECT RegionCode, RegionName FROM SalesDB.dbo.Regions;"
  }
]
  • The first route uses the configured database.

  • The second names the database and schema (SalesDB.dbo), so it reads from SalesDB.

  • The Resquel database account needs read permission in each database it queries.

The same approach works in SQL Query form actions.

Databases on different servers

Resquel and each SQL Query database type connect to one server. To use data from another server, ask your database administrator about a linked server or a view in the configured database.