Skip to content

Commit

Permalink
sqlite3 database files created
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunkay7 committed May 16, 2024
1 parent e1d4ffe commit c0103b5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions .idea/PsyCred.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified requirements.txt
Binary file not shown.
18 changes: 7 additions & 11 deletions src/backend/DBConnection.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
from flask import Flask, jsonify
import pyodbc
import sqlite3

app = Flask(__name__)

# Configuration
CONNECTION_STRING = 'Driver={ODBC Driver 18 for SQL Server};Server=tcp:dbserverpsy.database.windows.net,1433;Database=psycredDB;Uid={your_user_name};Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;Authentication=ActiveDirectoryIntegrated'

DATABASE = 'psycreditdb.db'

def get_db_connection():
return pyodbc.connect(CONNECTION_STRING)

return sqlite3.connect(DATABASE)

@app.route('/')
def index():
def test_connection():
try:
conn = get_db_connection()
if conn:
return jsonify("Connected")
conn.close()
return jsonify({'status': 'connected'})
except Exception as e:
return str(e)

return jsonify({'status': 'error', 'message': str(e)})

if __name__ == '__main__':
app.run(debug=True)
Empty file added src/backend/UserService.py
Empty file.

0 comments on commit c0103b5

Please sign in to comment.