Skip to content
This repository has been archived by the owner on Jul 25, 2019. It is now read-only.

pytatki.dbconnect.create_user()

Patryk Niedźwiedziński edited this page Nov 1, 2018 · 2 revisions

v1.0.1

create_user() - create new user and return its id

create_user(
    conn,
    login,
    password,
    email,
    status_id)
  • conn - connection used to insert data into the DB
  • login - login of the user
  • password - password of the user, it will be hashed
  • email - email of the user
  • status_id - status of user

Affected tables

  • user

Example

import pytatki

_, conn = connection()
user_id = pytatki.dbconnect.create_user(conn, "awesomeGuy", "12345", "awe@so.me", 1)
conn.commit()
_.close()
conn.close()
print(user_id)

See also

pytatki.dbconnect.connection()