1
0

Add info about plugin db schemas

This commit is contained in:
Dennis Reimann
2022-11-27 16:05:21 +01:00
parent 7591c3cb8b
commit 34246d8d25

View File

@@ -568,7 +568,7 @@ Then, inside `psql` you can select a database and interact with the tables:
\c btcpayservermainnet
# list tables
\dt+
\dt
# list users
SELECT "Id", "Email" FROM "AspNetUsers";
@@ -576,3 +576,20 @@ SELECT "Id", "Email" FROM "AspNetUsers";
# end session
\q
```
The main BTCPay Server database tables are part of the `public` schema.
Plugins have their own schema, named after the plugin.
By default, only the tables of the `public` schema are shown.
If you want to also see and select the plugin tables, you need to extend the search path:
```bash
# list plugin schemas
SELECT * FROM pg_catalog.pg_namespace WHERE nspname LIKE 'BTCPayServer.%';
# extend search path
SET search_path TO "BTCPayServer.Plugins.MyPlugin", public;
# table list now also shows the MyPlugin tables
\dt
```