Skip to content

Instantly share code, notes, and snippets.

View lucas-code42's full-sized avatar
📖
learning

Lucas Brandão lucas-code42

📖
learning
View GitHub Profile
@lucas-code42
lucas-code42 / rust-xp-02-postgresql-sqlx.rs
Created July 11, 2026 03:18 — forked from jeremychone/rust-xp-02-postgresql-sqlx.rs
Rust to PostgreSQL with SQLX | Rust By Example
#![allow(unused)] // silence unused warnings while exploring (to comment out)
use sqlx::postgres::{PgPoolOptions, PgRow};
use sqlx::{FromRow, Row};
// Youtube episode: https://youtu.be/VuVOyUbFSI0
// region: Section
// Start postgresql server docker image:
@lucas-code42
lucas-code42 / ip.go
Created March 31, 2024 22:42 — forked from miguelmota/ip.go
Golang get IP address from web HTTP request handler
package main
import (
"errors"
"log"
"net"
"net/http"
"strings"
)
@lucas-code42
lucas-code42 / error.go
Created January 15, 2024 01:40 — forked from renanbastos93/error.go
Custom errors in Golang
// ./custom/error.go
package myerrors
import (
"fmt"
)
type myError struct {
code int
msg string