commit
fa5d288c8e
2 changed files with 3 additions and 2 deletions
BIN
src/db/db_up
BIN
src/db/db_up
Binary file not shown.
|
@ -11,7 +11,8 @@ proc setupUsers*(conn: Turso) =
|
|||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
first_name VARCHAR(255) NOT NULL,
|
||||
last_name VARCHAR(255) NOT NULL,
|
||||
email VARCHAR(255) NOT NULL UNIQUE,
|
||||
email VARCHAR(255) NOT NULL,
|
||||
phone VARCHAR(255) NOT NULL,
|
||||
password VARCHAR(255) NOT NULL,
|
||||
created_at TEXT DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
||||
updated_at TEXT DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
||||
|
@ -20,7 +21,7 @@ proc setupUsers*(conn: Turso) =
|
|||
""")
|
||||
|
||||
proc createPost*(conn: Turso, user: User)=
|
||||
conn.execute(fmt"""INSERT INTO users (first_name, last_name, email, password, access_level) VALUES ("{user.firstName}", "{user.lastName}", "{user.email}", "{user.password}", {user.accessLevel});""")
|
||||
conn.execute(fmt"""INSERT INTO users (first_name, last_name, email, phone, password, access_level) VALUES ("{user.firstName}", "{user.lastName}", "{user.email}", "{user.phone}", "{user.password}", {user.accessLevel});""")
|
||||
|
||||
proc getUser*(conn: Turso, email: string, password: string): (bool, User)=
|
||||
var
|
||||
|
|
Loading…
Reference in a new issue