54cd9491c6
* V3-664 Extend User repository. Reimplemented with dbx * structure updated * redundant packages removed, structure simplified * fixing goimports * removed constuctor from user struct * separated types declarations from database file * test file renamed * fixes according to review * fixing goimports * fixing goimports
35 lines
718 B
Plaintext
35 lines
718 B
Plaintext
// dbx.v1 golang satellitedb.dbx .
|
|
|
|
model user (
|
|
key id
|
|
unique email
|
|
|
|
field id text
|
|
field first_name text ( updatable )
|
|
field last_name text ( updatable )
|
|
field email text ( updatable )
|
|
field password_hash blob ( updatable )
|
|
|
|
field created_at timestamp ( autoinsert )
|
|
)
|
|
|
|
read one (
|
|
select user
|
|
where user.email = ?
|
|
where user.password_hash = ?
|
|
)
|
|
read one (
|
|
select user
|
|
where user.id = ?
|
|
)
|
|
create user ( )
|
|
update user ( where user.id = ? )
|
|
delete user ( where user.id = ? )
|
|
|
|
//TODO: this entity will be used and updated in the next commit
|
|
model company (
|
|
key id
|
|
|
|
field id blob
|
|
field userId user.id cascade ( updatable )
|
|
) |