#### What Will I Learn? - You will learn how to use the Diesel ORM to build a schema - You will learn a way of connecting a Rust project to an SQL Database - You will learn how to properly build data models which implement code generation macros that create SQL #### Requirements - A moderate understanding of the Rust programming language - A little knowledge of SQL and SQL databases - A fair understanding of command lines/terminals and command line interfaces - An understanding of environment variables #### Difficulty - Intermediate #### Description In this video, we start building a **REST API** in the **Rust Programming language**. We use the **Diesel library** to build our database. We also explore different methods of *creating and migrating* our data models through the use of the **Diesel CLI** and the **Diesel macro system**. Finally, we use the **Diesel library** to help build out **declarative functions** that allow us to *insert, update, delete and view* the data from our database. These functions will eventually help us give this type of functionality to our API endpoint. The source code for this project can be found [here](https://github.com/tensor-programming/rust_api_part_1) #### Video Tutorial <iframe width="560" height="315" src="https://www.youtube.com/embed/VMZdGX9wC4g" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe> <br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@tensor/building-an-rest-api-in-rust-part-1">Utopian.io - Rewarding Open Source Contributors</a></em><hr/>
post_id | 25,949,119 | ||||||
---|---|---|---|---|---|---|---|
author | tensor | ||||||
permlink | building-an-rest-api-in-rust-part-1 | ||||||
category | utopian-io | ||||||
json_metadata | "{"type": "video-tutorials", "repository": {"owner": {"login": "rust-lang"}, "id": 724712, "full_name": "rust-lang/rust", "fork": false, "name": "rust", "html_url": "https://github.com/rust-lang/rust"}, "pullRequests": [], "format": "markdown", "links": ["https://github.com/tensor-programming/rust_api_part_1"], "app": "utopian/1.0.0", "moderator": {"pending": false, "account": "ewq", "reviewed": true, "flagged": false, "time": "2018-01-16T10:16:00.292Z"}, "platform": "github", "tags": ["utopian-io", "steemstem", "steemiteducation", "programming", "technology"], "community": "utopian", "users": ["tensor"]}" | ||||||
created | 2018-01-16 02:50:45 | ||||||
last_update | 2018-01-17 02:56:54 | ||||||
depth | 0 | ||||||
children | 3 | ||||||
net_rshares | 6,010,084,952,677 | ||||||
last_payout | 2018-01-23 02:50:45 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 32.306 SBD | ||||||
curator_payout_value | 13.049 SBD | ||||||
pending_payout_value | 0.000 SBD | ||||||
promoted | 0.000 SBD | ||||||
body_length | 1,575 | ||||||
author_reputation | 87,767,420,253,600 | ||||||
root_title | "Building a REST API in Rust (Part 1)" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 SBD | ||||||
percent_steem_dollars | 10,000 | ||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
pharesim | 0 | 87,393,654,635 | 0.02% | ||
lafona-miner | 0 | 120,764,488,152 | 2.5% | ||
kushed | 0 | 4,868,360,578 | 2% | ||
bue | 0 | 96,907,887,604 | 100% | ||
mrs.agsexplorer | 0 | 5,731,726,551 | 2% | ||
justtryme90 | 0 | 116,405,225,558 | 4.25% | ||
anwenbaumeister | 0 | 38,522,931,505 | 2% | ||
roelandp | 0 | 87,002,425,338 | 1% | ||
liberosist | 0 | 117,931,016,628 | 2% | ||
toxichan | 0 | 451,859,873 | 2% | ||
timsaid | 0 | 2,484,981,463 | 1% | ||
velourex | 0 | 3,226,909,343 | 2% | ||
freyman | 0 | 10,753,016,289 | 70% | ||
lemouth | 0 | 17,025,822,208 | 5% | ||
rjbauer85 | 0 | 157,941,436 | 5% | ||
anarchyhasnogods | 0 | 13,479,662,919 | 5% | ||
steemedia | 0 | 213,319,003 | 2% | ||
meerkat | 0 | 53,365,255,052 | 2% | ||
curie | 0 | 100,147,623,518 | 2% | ||
cebymaster | 0 | 265,527,046 | 2% | ||
hendrikdegrote | 0 | 1,032,054,203,003 | 2.4% | ||
steemstem | 0 | 54,634,822,890 | 5% | ||
cotidiana | 0 | 237,487,749 | 2% | ||
teofilex11 | 0 | 1,233,669,593 | 2% | ||
foundation | 0 | 434,700,973 | 5% | ||
ethandsmith | 0 | 2,067,544,860 | 0.5% | ||
the-devil | 0 | 1,067,866,315 | 5% | ||
thevenusproject | 0 | 2,650,578,940 | 5% | ||
dna-replication | 0 | 2,775,684,919 | 10% | ||
filotasriza3 | 0 | 7,501,247,463 | 15% | ||
oscarps | 0 | 535,588,780 | 1.92% | ||
pacokam8 | 0 | 76,018,390 | 0.4% | ||
fronttowardenemy | 0 | 184,201,632 | 0.32% | ||
jamhuery | 0 | 1,500,810,518 | 5% | ||
dickturpin | 0 | 341,831,763 | 2% | ||
scrooger | 0 | 283,691,581 | 0.96% | ||
mobbs | 0 | 5,815,255,601 | 2.5% | ||
bp423 | 0 | 477,127,027 | 2% | ||
kryzsec | 0 | 821,603,745 | 5% | ||
trumpman | 0 | 5,298,339,848 | 5% | ||
diggerdugg | 0 | 201,668,805 | 2% | ||
dber | 0 | 3,465,684,122 | 5% | ||
maxer27 | 0 | 352,803,915 | 2% | ||
kerriknox | 0 | 21,544,060,661 | 5% | ||
alexander.alexis | 0 | 121,656,167 | 0.5% | ||
tensor | 0 | 9,368,104,659 | 100% | ||
mystifact | 0 | 739,072,246 | 5% | ||
nitesh9 | 0 | 1,192,453,669 | 5% | ||
fancybrothers | 0 | 881,130,819 | 3.5% | ||
himal | 0 | 254,613,377 | 5% | ||
ovij | 0 | 675,363,755 | 5% | ||
jamescash | 0 | 570,791,882 | 100% | ||
kharrazi | 0 | 2,091,318,834 | 2.5% | ||
gamesjoyce | 0 | 332,550,998 | 2% | ||
somethingburger | 0 | 268,650,829 | 5% | ||
tormiwah | 0 | 360,924,821 | 2.5% | ||
rayken04 | 0 | 68,117,142 | 10% | ||
qurator | 0 | 82,564,307,568 | 3.2% | ||
opaulo | 0 | 13,162,800,879 | 13% | ||
carloserp-2000 | 0 | 529,685,502 | 5% | ||
rachelsmantra | 0 | 193,103,174 | 5% | ||
gra | 0 | 1,672,975,037 | 5% | ||
utopian-io | 0 | 3,830,767,799,655 | 2.17% | ||
kedi | 0 | 755,604,608 | 3.5% | ||
rayhanahmed | 0 | 666,920,158 | 100% | ||
robertlyon | 0 | 5,565,950,173 | 100% | ||
raci | 0 | 1,224,041,260 | 5% | ||
kenadis | 0 | 893,822,509 | 5% | ||
amavi | 0 | 705,569,192 | 1% | ||
geekpowered | 0 | 2,082,636,000 | 1% | ||
gentleshaid | 0 | 1,215,683,166 | 5% | ||
steembasicincome | 0 | 2,993,443,473 | 2% | ||
rantar | 0 | 9,814,353,981 | 100% | ||
bizheng | 0 | 10,585,058,979 | 40% | ||
sco | 0 | 257,663,151 | 1% | ||
hidden84 | 0 | 166,539,731 | 2% | ||
hadji | 0 | 72,266,027 | 5% | ||
superoo7 | 0 | 3,374,238,765 | 100% | ||
moonrise | 0 | 625,172,844 | 100% | ||
wiredelta | 0 | 614,439,855 | 100% |
Thank you for the contribution. It has been approved. You can contact us on [Discord](https://discord.gg/uTyJkNm). **[[utopian-moderator]](https://utopian.io/moderators)**
post_id | 26,005,198 |
---|---|
author | ewq |
permlink | re-tensor-building-an-rest-api-in-rust-part-1-20180116t101604105z |
category | utopian-io |
json_metadata | "{"app": "utopian/1.0.0", "community": "utopian", "tags": ["utopian-io"]}" |
created | 2018-01-16 10:16:06 |
last_update | 2018-01-16 10:16:06 |
depth | 1 |
children | 1 |
net_rshares | 197,385,340,209 |
last_payout | 2018-01-23 10:16:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 1.395 SBD |
curator_payout_value | 0.462 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 172 |
author_reputation | 2,121,615,436,892 |
root_title | "Building a REST API in Rust (Part 1)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
utopian.tip | 0 | 197,385,340,209 | 17.46% |
Hey @ewq, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!
post_id | 26,060,113 |
---|---|
author | utopian.tip |
permlink | re-re-tensor-building-an-rest-api-in-rust-part-1-20180116t101604105z-20180116t155725 |
category | utopian-io |
json_metadata | {} |
created | 2018-01-16 15:57:27 |
last_update | 2018-01-16 15:57:27 |
depth | 2 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-01-23 15:57:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 153 |
author_reputation | 238,049,167,312 |
root_title | "Building a REST API in Rust (Part 1)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
### Hey @tensor I am @utopian-io. I have just upvoted you! #### Achievements - You have less than 500 followers. Just gave you a gift to help you succeed! - Seems like you contribute quite often. AMAZING! #### Community-Driven Witness! I am the first and only Steem Community-Driven Witness. <a href="https://discord.gg/zTrEMqB">Participate on Discord</a>. Lets GROW TOGETHER! - <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for my Witness With SteemConnect</a> - <a href="https://v2.steemconnect.com/sign/account-witness-proxy?proxy=utopian-io&approve=1">Proxy vote to Utopian Witness with SteemConnect</a> - Or vote/proxy on <a href="https://steemit.com/~witnesses">Steemit Witnesses</a> [![mooncryption-utopian-witness-gif](https://steemitimages.com/DQmYPUuQRptAqNBCQRwQjKWAqWU3zJkL3RXVUtEKVury8up/mooncryption-s-utopian-io-witness-gif.gif)](https://steemit.com/~witnesses) **Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x**
post_id | 26,007,099 |
---|---|
author | utopian-io |
permlink | re-tensor-building-an-rest-api-in-rust-part-1-20180116t103106557z |
category | utopian-io |
json_metadata | "{"app": "utopian/1.0.0", "community": "utopian", "tags": ["utopian-io"]}" |
created | 2018-01-16 10:31:06 |
last_update | 2018-01-16 10:31:06 |
depth | 1 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-01-23 10:31:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 1,082 |
author_reputation | 152,913,012,544,965 |
root_title | "Building a REST API in Rust (Part 1)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |