aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/fixtures
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-04-09 11:00:30 +0200
committerChocobozzz <me@florianbigard.com>2020-04-09 11:00:30 +0200
commit1b05d82d861f42c27766e9f24d8d55e68b0cf098 (patch)
treebbf14abc606dd3f8f0c13625afbdf3b17fea3a23 /server/tests/fixtures
parentbc0d801bb7a0cc503c1637f4a07bb51d68d85608 (diff)
downloadPeerTube-1b05d82d861f42c27766e9f24d8d55e68b0cf098.tar.gz
PeerTube-1b05d82d861f42c27766e9f24d8d55e68b0cf098.tar.zst
PeerTube-1b05d82d861f42c27766e9f24d8d55e68b0cf098.zip
Add SQL query support in plugins
Diffstat (limited to 'server/tests/fixtures')
-rw-r--r--server/tests/fixtures/peertube-plugin-test-four/main.js27
-rw-r--r--server/tests/fixtures/peertube-plugin-test-four/package.json20
2 files changed, 47 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 @@
1async 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
18async function unregister () {
19 return
20}
21
22module.exports = {
23 register,
24 unregister
25}
26
27// ###########################################################################
diff --git a/server/tests/fixtures/peertube-plugin-test-four/package.json b/server/tests/fixtures/peertube-plugin-test-four/package.json
new file mode 100644
index 000000000..dda3c7f37
--- /dev/null
+++ b/server/tests/fixtures/peertube-plugin-test-four/package.json
@@ -0,0 +1,20 @@
1{
2 "name": "peertube-plugin-test-four",
3 "version": "0.0.1",
4 "description": "Plugin test 4",
5 "engine": {
6 "peertube": ">=1.3.0"
7 },
8 "keywords": [
9 "peertube",
10 "plugin"
11 ],
12 "homepage": "https://github.com/Chocobozzz/PeerTube",
13 "author": "Chocobozzz",
14 "bugs": "https://github.com/Chocobozzz/PeerTube/issues",
15 "library": "./main.js",
16 "staticDirs": {},
17 "css": [],
18 "clientScripts": [],
19 "translations": {}
20}