SQLc is the perfect tool for those who don't like ORMs

Published: 14 October 2024
on channel: Dreams of Code
99,740
3.5k

Click this link https://sponsr.is/bootdev_dreamsofcode and use my code DREAMSOFCODE to get 25% off your first payment for boot.dev. That’s 25% off your first month or your first year, depending on the subscription you choose.

When it comes to working with a database in Go, I often make use of the Repository Design Pattern, which wraps the queries into type safe functions.

Whilst this is my preferred approach, it does take a lot of time as it's mostly tedious to do. Fortunately, there's a new tool out there called SQLc which solves this, and many other problems.

This video is sponsored by boot.dev

Video Links:
SQLc: https://sqlc.dev/
Code: https://github.com/dreamsofcode-io/sqlc
Repository Design Pattern:   / repository-design-pattern  

Gear Used:
Keyboard: ZSA Voyager
Mouse: https://amzn.to/3UbDaHM
Camera: https://amzn.to/4eFPvvP
Lens: https://amzn.to/3YmMR8v
Microphone: https://amzn.to/4eFPvvP
Video Interface: https://amzn.to/3zUjRvF
Audio Interface: https://amzn.to/3U8Zd1s

Join this channel to get access to perks:
   / @dreamsofcode  

Join Discord:   / discord  
Join Twitter:   / dreamsofcode_io  

00:00:00 Intro
00:01:49 SQLc
00:04:02 Sponsor
00:05:43 Simple Example
00:07:22 Define Schema
00:08:14 Define Queries
00:09:03 Query Annotations
00:10:11 Code Gen Config
00:10:55 Installing SQLc
00:11:28 Generated Code
00:12:18 Integration
00:14:07 Insert Query
00:16:12 Returning *
00:17:49 Overrides
00:20:04 json tags
00:20:31 Embedded Structs
00:22:05 Prepared Statements
00:22:36 Transactions
00:26:25 Query Organization


Watch video SQLc is the perfect tool for those who don't like ORMs online without registration, duration hours minute second in high quality. This video was added by user Dreams of Code 14 October 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 99,740 once and liked it 3.5 thousand people.