Testing

Let's test our tool. Compile and run it with the following commands:

cargo run -- add user1 [email protected]
cargo run -- add user2 [email protected]
cargo run -- add userx [email protected]

If you add filtering and call the list subcommand, you will see the following output:

cargo run -- list
User { id: "a9ec3bae-c8c6-4580-97e1-db8f988f10f8", name: "user1", email: "[email protected]" }
User { id: "7f710d18-aea5-46f9-913c-b60d4e4529c9", name: "user2", email: "[email protected]" }

We got a perfect example of mapping pure Rust types to relational database types.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.181.252