aboutsummaryrefslogtreecommitdiff
path: root/server/database/main.go
diff options
context:
space:
mode:
authorMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-05-01 09:43:59 +0530
committerMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-05-01 09:43:59 +0530
commit45a3b94f133ebcd9abff2baf266d0b3f691d2790 (patch)
tree0716d12d6d25ead8b1905cd5b7ed70463c2fc458 /server/database/main.go
parent0fa16426f56120c4eb18bc18c202703c460daed8 (diff)
defined api group to handle DB functions regarding people/customers
Diffstat (limited to 'server/database/main.go')
-rw-r--r--server/database/main.go29
1 files changed, 19 insertions, 10 deletions
diff --git a/server/database/main.go b/server/database/main.go
index ecff904..de2365c 100644
--- a/server/database/main.go
+++ b/server/database/main.go
@@ -17,17 +17,26 @@ var myDatabase *sql.DB
func StartDB() {
myDatabase, _ = sql.Open("sqlite3", "./openbills.db")
- init_registered_items, _ := myDatabase.Prepare(
- `CREATE TABLE IF NOT EXISTS registered_items
+ init_items, _ := myDatabase.Prepare(
+ `CREATE TABLE IF NOT EXISTS Items
(id INTEGER PRIMARY KEY AUTOINCREMENT,
- model TEXT NOT NULL,
- desc TEXT,
- price REAL,
- hsn BLOB,
- gst REAL,
- category TEXT,
- brand TEXT)`,
+ Model TEXT NOT NULL,
+ Desc TEXT,
+ Price REAL,
+ Hsn BLOB,
+ Gst REAL,
+ Category TEXT,
+ Brand TEXT)`,
)
- init_registered_items.Exec()
+ init_items.Exec()
+
+ init_people, _ := myDatabase.Prepare(
+ `CREATE TABLE IF NOT EXISTS People
+ (id INTEGER PRIMARY KEY AUTOINCREMENT,
+ Name TEXT,
+ Phone TEXT,
+ Email TEXT)`,
+ )
+ init_people.Exec()
}