Build an Async API in Golang (part 02 - User Data Access Layer w/ SQLx + Testing)

  Рет қаралды 1,000

devtool

devtool

Күн бұрын

In this part of the Async API in Golang series, we'll implement the data access layer for the users model and go over how to integration test with our Postgres database. We're making use of the popular SQLx Go library.

Пікірлер: 6
@ranit-biswas
@ranit-biswas 27 күн бұрын
Great man. I don't have much knowledge about integration testing. But what I know that we don't do mocking and stubbing in integration test.. rather db interaction in real is happened during integration testing. Mocking and stubbing are done during unit testing. That's how I segregate b/w integration and unit testing. Please correct me if I'm wrong.
@thedevtool
@thedevtool 27 күн бұрын
@@ranit-biswas that’s correct. A unit test is not testing functionality of underlying dependencies. Rather, it will mock their behavior to ensure we’re using the dependencies correctly. However, people can get pedantic about what’s a unit versus integration test. You can just call it automated testing.
@samuelopeyemi8377
@samuelopeyemi8377 8 күн бұрын
Well done, chief! Why are you adding password-hashing logic in the store? All such logic should be moved to the service layer or handler so the store stays focused on database-related tasks.
@thedevtool
@thedevtool 8 күн бұрын
@@samuelopeyemi8377 yep that can totally be moved to the API handler layer if preferred.
@samuelopeyemi8377
@samuelopeyemi8377 8 күн бұрын
@@thedevtool Thank you for your work!
@thedevtool
@thedevtool 8 күн бұрын
@@samuelopeyemi8377 no problem thanks for watching!
Непосредственно Каха: сумка
0:53
К-Media
Рет қаралды 12 МЛН
ВЛОГ ДИАНА В ТУРЦИИ
1:31:22
Lady Diana VLOG
Рет қаралды 1,2 МЛН
why don't signals work in docker?
12:30
anthonywritescode
Рет қаралды 7 М.
SQLc is the perfect tool for those who don't like ORMs
28:11
Dreams of Code
Рет қаралды 120 М.
DeepSeek ! How is it different?
4:55
Learn AI Labs
Рет қаралды 13
Build an Async API in Golang (part 05 - User Signin)
36:11
SQLx is my favorite PostgreSQL driver to use with Rust.
9:47
Dreams of Code
Рет қаралды 61 М.
Go - SQL Databases in Golang with the database/sql package
31:16
SQLC in Go - Auto-Generating Database Code in Golang
32:02
BugBytes
Рет қаралды 16 М.
Why I Use Golang In 2024
9:21
ThePrimeTime
Рет қаралды 379 М.
#71 Golang - Master SQLX: Simplify Database Operations
13:38
codeHeim
Рет қаралды 2,2 М.
Непосредственно Каха: сумка
0:53
К-Media
Рет қаралды 12 МЛН