# Liss
```python!
db = pg.connect(url)
cursor = db.cursor()
users = cursor.execute("SELECT * from users;")
user = cursor.execute("SELECT * from users where id = %s AND name = %s", (1,"Liss"))
## never do this
user = cursor.execute("SELECT * from users where id = "+1+" AND name = %s", (1,"Liss"))
## to get stuff to save after you do an insert:
cursor.execute("INSERT INTO users (id, name) VALUES (1, 'Lizz')")
cursor.commit()
```
```python!
class User:
#sqlalchemy stuff...
def validate_password():
pass
def add_friend():
## find the friend
## add an entry for both of you
## send notifications
```
## Interpret User Input Flow
User Inputs Next Action
Are we in a conversation?
Interpret it as input
Are we in a combat?
Interpret Combat Action
Are we moving?
Move character logic
Are we taking an action on the scene?
Act on current scene
Are we inputting a special command (like view inventory, or something else deterministic?)
Logic for special commands
```python
while user_input != "/quit"
if in_conversation:
return handle_conversation(user_input)
if in_combat:
etc
if moving:
etc
if action_on_scene:
act_on_scene(user_input,scene)
if user_input.startswith("/"):
switch user_input:
case "/inventory":
display_inventory()
case "/quests":
show_quests()
user_input = input("> ")
```
For the map, make an edge-list
```sql!
CREATE TABLE location_adjacency (
id serial PRIMARY KEY,
location_1 int not null,
location_2 int not null,
description text
)
```