04-databases/simple-crud cleanup

This commit is contained in:
programarivm 2019-09-27 11:30:58 +01:00
parent 04f454ca59
commit fca4dce961
2 changed files with 38 additions and 36 deletions

View File

@ -3,69 +3,69 @@
s ok=$$set^UserRoutines(1,"alice~password~alice-jones@no-reply.com~Alice Jones")
i ok=1 d
. w "User successfully created!",!,!
. w "User successfully created!",!
e d
. w "Whoops! The user could not be created.",!,!
. w "Whoops! The user could not be created.",!
s ok=$$set^UserRoutines(2,"bob~password~bob-smith@no-reply.com~Bob Smith")
i ok=1 d
. w "User successfully created!",!,!
. w "User successfully created!",!
e d
. w "Whoops! The user could not be created.",!,!
. w "Whoops! The user could not be created.",!
; fetch a user
s ok=$$fetch^UserRoutines(1,.data)
i ok=1 d
. w "User successfully fetched!",!
. w "Username: ",data("username"),!
. w "Email: ",data("email"),!
. w "Full name: ",data("fullname"),!,!
. w !,"User successfully fetched!",!
. w "username: ",data("username"),!
. w "email: ",data("email"),!
. w "fullname: ",data("fullname"),!
e d
. w "Whoops! The user could not be fetched.",!,!
. w "Whoops! The user could not be fetched.",!
; update a user
s ok=$$set^UserRoutines(1,"amelia~password~amelia-roberts@no-reply.com~Amelia Roberts")
i ok=1 d
. w "User successfully updated!",!,!
. w !,"User successfully updated!",!
e d
. w "Whoops! The user could not be updated.",!,!
. w !,"Whoops! The user could not be updated.",!
; fetch a user
s ok=$$fetch^UserRoutines(1,.data)
i ok=1 d
. w "User successfully fetched!",!
. w "Username: ",data("username"),!
. w "Email: ",data("email"),!
. w "Full name: ",data("fullname"),!,!
. w !,"User successfully fetched!",!
. w "username: ",data("username"),!
. w "email: ",data("email"),!
. w "fullname: ",data("fullname"),!
e d
. w "Whoops! The user could not be fetched.",!,!
. w "Whoops! The user could not be fetched.",!
; delete a user
s ok=$$remove^UserRoutines(2)
i ok=1 d
. w "User successfully deleted!",!,!
. w !,"User successfully deleted!",!
e d
. w "Whoops! The user could not be deleted.",!,!
. w !,"Whoops! The user could not be deleted.",!
; fetch a user
s ok=$$fetch^UserRoutines(2,.data)
i ok=1 d
. w "User successfully fetched!",!
. w "Username: ",data("username"),!
. w "Email: ",data("email"),!
. w "Full name: ",data("fullname"),!,!
. w !,"User successfully fetched!",!
. w "username: ",data("username"),!
. w "email: ",data("email"),!
. w "fullname: ",data("fullname"),!
e d
. w "Whoops! The user could not be fetched.",!,!
. w "Whoops! The user could not be fetched.",!
; drop database
s ok=$$drop^DatabaseRoutines()
i ok=1 d
. w "Database successfully dropped!",!
. w !,"Database successfully dropped!",!
e d
. w "Whoops! The database could not be dropped.",!
. w !,"Whoops! The database could not be dropped.",!

View File

@ -199,31 +199,33 @@ Copy the examples into your `~/.fis-gtm/V6.3-003A_x86_64/r` folder and run:
### [`simple-crud/Main.m`](https://github.com/programarivm/mumps-examples/blob/master/04-databases/simple-crud/Main.m)
User successfully created!
User successfully created!
User successfully fetched!
Username: alice
Email: alice-jones@no-reply.com
Full name: Alice Jones
username: alice
email: alice-jones@no-reply.com
fullname: Alice Jones
User successfully updated!
User successfully fetched!
Username: amelia
Email: amelia-roberts@no-reply.com
Full name: Amelia Roberts
username: amelia
email: amelia-roberts@no-reply.com
fullname: Amelia Roberts
User successfully deleted!
User successfully fetched!
Username:
Email:
Full name:
username:
email:
fullname:
Database successfully dropped!
> For further details also visit [UserRoutines.m](https://github.com/programarivm/mumps-examples/blob/master/04-databases/simple-crud/UserRoutines.m)
For further details also visit:
- [`DatabaseRoutines.m`](https://github.com/programarivm/mumps-examples/blob/master/04-databases/simple-crud/DatabaseRoutines.m)
- [`UserRoutines.m`](https://github.com/programarivm/mumps-examples/blob/master/04-databases/simple-crud/UserRoutines.m)
### [`blog/Main.m`](https://github.com/programarivm/mumps-examples/blob/master/04-databases/blog/Main.m)