1. PostgreSQL copy of all MySQL created and tested.\n 2. Purchase Orders and Sales Orders and stock level management added to MySQL, PostgreSQL, and server and front end code.

This commit is contained in:
2024-07-05 20:34:11 +01:00
parent 3a2a164213
commit 6f4e329258
3049 changed files with 535753 additions and 3022 deletions

View File

@@ -0,0 +1,34 @@
"""
Project: PARTS Website
Author: Edward Middleton-Smith
Precision And Research Technology Systems Limited
Technology: Helpers
Feature: PostgreSQL Database Helper
"""
# internal
# external
import psycopg2
# from psycopg2 import sql
from pydantic import BaseModel
from flask import Flask
class Helper_DB_PostgreSQL(BaseModel):
app: Flask
def __init__(self, app):
super().__init__(app=app)
# self.app = app
def get_db_connection(self):
return psycopg2.connect(
dbname = self.app.config['DB_NAME'],
user = self.app.config['DB_USER'],
password = self.app.config['DB_PASSWORD'],
host = self.app.config['DB_HOST'],
port = self.app.config['DB_PORT']
)