drogonframework / drogonframework/drogon

Ability to choose the default schema (search_path)

Open
#1,792 4 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
14.3k
Forks
1.4k
Avg merge
1d 12h
Merged PRs (30d)
15

Description

I'm unable to choose the schema to use when connecting to the database. Currently I have to prepend the schema name before the table name in every query.

I also tried the following command and it didn't work.
`clientPtr->execSqlSync("SET search_path = $1", "my_schema");`

When creating a Postgres connection in other libraries, we usually use arguments like `options='-csearch_path=my_schema'` to specify the schema.

It would be good if there were an option in config.json to choose the default schema. The parameter could be either
`"schema": "my_schema"`
or
`"rdbms_options": "-csearch_path=my_schema"`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.