Database Usage in Golang Part 1: Basic Interaction

preview_player
Показать описание
In this tutorial we will learn the fundamentals of talking to SQL databases from Golang. We will connect to an SQLite database in order to read and write data to our hard drive. Although this is not an SQL tutorial, the examples are simple enough to grasp their basic idea. Feel free to do some research on relational databases if you have not worked with them yet.

Links:

Timestamps
00:00 Content overview
02:07 Project setup
03:39 Intro SQL API and chosen DB (SQL package, SQLite)
08:13 Golang SQLite driver documentation
12:20 Creating a DB connection (using log.Fatal for error handling)
16:46 Creating a table (using multiline strings)
21:42 Inserting into our table (placeholder parameters, extracting an error check function)
25:10 Reading the first row from our table (We could also use QueryRow instead.)
32:59 Short summary
34:00 Resource cleanup (close)
36:22 Outlook part 2
Рекомендации по теме
visit shbcf.ru