Skip to content

Commit 19750ee

Browse files
authored
Merge pull request #78 from oslabs-beta/controlCheck
Add null check on TableName and Constraint Name on Dump Parse
2 parents a48e103 + b9d6ba0 commit 19750ee

File tree

8 files changed

+34
-17
lines changed

8 files changed

+34
-17
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,15 @@ dist/
1111
# package-lock
1212
package-lock.json
1313

14+
<<<<<<< HEAD
15+
#EBStalk
16+
.elasticbeanstalk/
17+
18+
.env
19+
# Elastic Beanstalk Files
20+
.elasticbeanstalk/*
21+
!.elasticbeanstalk/*.cfg.yml
22+
!.elasticbeanstalk/*.global.yml
23+
=======
1424
.env
25+
>>>>>>> 342d51b7256a6ae08cc11165302b8bca3999415a

Dockerfile

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

client/assets/.SQLfile.gif.icloud

-161 Bytes
Binary file not shown.

client/pages/Login.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,7 @@ export default function Login() {
6060
const google = () => {
6161
const strWindowFeatures =
6262
'toolbar=no, menubar=no, width=600, height=700, top=100, left=100';
63-
window.open(
64-
// '/auth/google',
65-
'http://localhost:8080/auth/google',
66-
'_self',
67-
strWindowFeatures
68-
);
63+
window.open('http://localhost:8080/auth/google', '_self', strWindowFeatures);
6964
};
7065

7166
/*

client/pages/Signup.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ export default function Signup() {
6060
const google = () => {
6161
const strWindowFeatures =
6262
'toolbar=no, menubar=no, width=600, height=700, top=100, left=100';
63-
window.open('/auth/google', '_self', strWindowFeatures);
63+
window.open(
64+
'https://dbspy.net/auth/google',
65+
'_self',
66+
strWindowFeatures
67+
);
6468
};
6569

6670
/*

dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM node:16.3
2+
WORKDIR /usr/src/app
3+
COPY package.json /usr/src/app
4+
RUN npm install
5+
COPY . ./
6+
RUN ["npm", "run", "build"]
7+
EXPOSE 3000
8+
ENTRYPOINT ["node", "./server/server.js"]

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"version": "1.0.0",
44
"description": "Visualizing existing database",
55
"main": "index.js",
6+
"engines": {
7+
"npm": "6.x",
8+
"node": "16.x"
9+
},
610
"scripts": {
711
"test2": "tldr curl",
812
"test": "jest",

server/controllers/dataController.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ dataController.getSchema = (req, res, next) => {
146146

147147
// Option 2 - Dev
148148
fs.readFile(
149-
path.join(__dirname, '../db_schemas/vjcmcautvjcmcaut1657127402.sql'),
149+
path.join(__dirname, '../db_schemas/rpvgbcdirpvgbcdi1660582287.sql'),
150150
'utf8',
151151
(error, data) => {
152152
if (error) {
@@ -557,6 +557,8 @@ function parseTableName(name) {
557557
}
558558

559559
function parseAlterTable(tableName, constraint) {
560+
561+
560562
// const tableName = tmp.match(/(?<=ALTER\sTABLE\s)([a-zA-Z_]+)(?=\sADD\sCONSTRAINT)/)[0];
561563

562564
// console.log('tableName in parseAlterTable------>', tableName);
@@ -686,7 +688,8 @@ function parseSql(text) {
686688
tname = tableList[i].Name;
687689
}
688690
}
689-
691+
//check for TableName and following line with constraint bound on database
692+
if (tname !== null && lines[i+1] !== null)
690693
parseAlterTable(tname, lines[i + 1]);
691694
i += 3;
692695
}

0 commit comments

Comments
 (0)