diff options
author | Chocobozzz <me@florianbigard.com> | 2020-04-09 11:00:30 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-04-09 11:00:30 +0200 |
commit | 1b05d82d861f42c27766e9f24d8d55e68b0cf098 (patch) | |
tree | bbf14abc606dd3f8f0c13625afbdf3b17fea3a23 /server/tests/fixtures/peertube-plugin-test-four/main.js | |
parent | bc0d801bb7a0cc503c1637f4a07bb51d68d85608 (diff) | |
download | PeerTube-1b05d82d861f42c27766e9f24d8d55e68b0cf098.tar.gz PeerTube-1b05d82d861f42c27766e9f24d8d55e68b0cf098.tar.zst PeerTube-1b05d82d861f42c27766e9f24d8d55e68b0cf098.zip |
Add SQL query support in plugins
Diffstat (limited to 'server/tests/fixtures/peertube-plugin-test-four/main.js')
-rw-r--r-- | server/tests/fixtures/peertube-plugin-test-four/main.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test-four/main.js b/server/tests/fixtures/peertube-plugin-test-four/main.js new file mode 100644 index 000000000..9abb73646 --- /dev/null +++ b/server/tests/fixtures/peertube-plugin-test-four/main.js | |||
@@ -0,0 +1,27 @@ | |||
1 | async function register ({ | ||
2 | peertubeHelpers | ||
3 | }) { | ||
4 | peertubeHelpers.logger.info('Hello world from plugin four') | ||
5 | |||
6 | const username = 'root' | ||
7 | const results = await peertubeHelpers.database.query( | ||
8 | 'SELECT "email" from "user" WHERE "username" = $username', | ||
9 | { | ||
10 | type: 'SELECT', | ||
11 | bind: { username } | ||
12 | } | ||
13 | ) | ||
14 | |||
15 | peertubeHelpers.logger.info('root email is ' + results[0]['email']) | ||
16 | } | ||
17 | |||
18 | async function unregister () { | ||
19 | return | ||
20 | } | ||
21 | |||
22 | module.exports = { | ||
23 | register, | ||
24 | unregister | ||
25 | } | ||
26 | |||
27 | // ########################################################################### | ||