1seok2

feat: add with database

No preview for this file type
No preview for this file type
1 +build/
2 +gulpfile.js
3 +gulp.js
4 +webpack.config.js
1 +{
2 + "extends": "./node_modules/gts/"
3 +}
1 +export const formatNumber = (number : number) : string => {
2 + if(`${number}`.length > 6) {
3 + return `${Math.floor(number / 1000000)}m`
4 + }
5 + else if(`${number}`.length > 3) {
6 + return `${Math.floor(number / 1000)}k`
7 + } else {
8 + return `${number}`;
9 + }
10 +}
...\ No newline at end of file ...\ No newline at end of file
1 -INSTAGRAM_URL="https://instagram.com" 1 +INSTAGRAM_URL = "https://instagram.com"
2 +DATABASE_URL = "localhost:1521"
......
File mode changed
1 +import cx_Oracle
2 +import os
3 +from config.key import DATABASE_ID, DATABASE_PW
4 +from config.URLs import DATABASE_URL
5 +
6 +os.putenv('NLS_LANG', '.UTF8')
7 +
8 +
9 +def connectDB():
10 + connection = cx_Oracle.connect(DATABASE_ID, DATABASE_PW, DATABASE_URL)
11 +
12 + cursor = connection.cursor()
13 +
14 + # cursor.execute("""
15 + # select name
16 + # from test_db
17 + # where text = :texting""",
18 + # texting="테스트"
19 + # )
20 +
21 + return cursor
22 +
23 +
24 +def closeDB(cursor):
25 + cursor.close()
...\ No newline at end of file ...\ No newline at end of file