Skip to content

Commit 952ac35

Browse files
committed
Switch to using typescript
1 parent 24c108f commit 952ac35

File tree

18 files changed

+4570
-575
lines changed

18 files changed

+4570
-575
lines changed

.eslintrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": [
5+
"@typescript-eslint"
6+
],
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/eslint-recommended",
10+
"plugin:@typescript-eslint/recommended"
11+
],
12+
"rules": {
13+
"@typescript-eslint/no-explicit-any": 0
14+
}
15+
}

.eslintrc.js

Lines changed: 0 additions & 297 deletions
This file was deleted.

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"singleQuote": true,
3-
"trailingComma": "all"
3+
"trailingComma": "es5"
44
}

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Removes temporary files.
5959
If you set the correct environment variables you can also compile and install the extension using npm:
6060

6161
npm run compile
62-
npm run install
62+
npm run setup
6363
npm run clean
6464

6565
# Installation
@@ -109,14 +109,22 @@ will create a database called **mysql_note**, register the mysql plugin and crea
109109

110110
# Running
111111

112+
For production mode you first need to build:
113+
114+
npm run build
115+
112116
Start the server with the default settings:
113117

114118
npm run dev
115119

116-
To build and run the application in production using pm2:
120+
To run the application in production using pm2:
117121

118122
npm run start
119123

124+
To run the application using typescript:
125+
126+
npm run start-ts
127+
120128
- Notice, that the `index.html` will be created if it does not yet exists.
121129
- Go to address **http://localhost/<install_dir>/index.html** in your browser and start receiving notifications from your database.
122130

@@ -174,7 +182,7 @@ The websocket port that will be used, default is 8080.
174182

175183
AUTO_ACCEPT_CONNECTION=1
176184

177-
Auto accept any connetions, default 0.
185+
Auto accept any connections, default 0.
178186

179187
ALLOWED_ORIGINS=localhost
180188

bin/test.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,21 @@ CREATE FUNCTION MySQLNotification RETURNS INTEGER SONAME 'mysql-notification.so'
1616

1717
DELIMITER @@
1818

19+
DROP TRIGGER IF EXISTS trigger1;
1920
CREATE TRIGGER trigger1 AFTER INSERT ON post
2021
FOR EACH ROW
2122
BEGIN
2223
SELECT MySQLNotification(NEW.id, 2) INTO @x;
2324
END@@
2425

26+
DROP TRIGGER IF EXISTS trigger2;
2527
CREATE TRIGGER trigger2 AFTER UPDATE ON post
2628
FOR EACH ROW
2729
BEGIN
2830
SELECT MySQLNotification(NEW.id, 3) INTO @x;
2931
END@@
3032

33+
DROP TRIGGER IF EXISTS trigger3;
3134
CREATE TRIGGER trigger3 AFTER DELETE ON post
3235
FOR EACH ROW
3336
BEGIN

mysql-plugin/src/makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ WEBSOCKET_PORT?=8080
88
mysql-notification : mysql-notification.c
99
${CC} -c -D SERVER_PORT=${SERVER_PORT} -D SERVER_ADDRESS='${SERVER_ADDRESS}' -D WEBSOCKET_PORT=${WEBSOCKET_PORT} -Wall -fpic ${CCFLAGS} -o $@.o -I${MYSQL_INCLUDE_DIR} $?
1010
${CC} -shared -o $@.so $@.o
11+
chmod 0644 $@.so
1112

1213
install : mysql-notification.so
1314
cp $? ${MYSQL_PLUGIN_DIR}/${TARGET_FILE}.so

0 commit comments

Comments
 (0)