当前位置:网站首页>Raw and scan of gorm
Raw and scan of gorm
2022-08-05 00:19:00 【Kageyuki three thousand】
Gorm's Raw and Scan
Raw
- Chinese: Native
Role: used to write Raw sql statements (native sql statements) when writing gorm statements
Gorm official introduction Scan:
https://gorm.io/en_US/docs/query.html#Scan
Scanning results into a struct works similarly to the way we use Find
Baidu Translate: Scanning results into a structure works like "Find"
type Result struct {Name stringAge int}var result Resultdb.Table("users").Select("name", "age").Where("name = ?", "Antonio").Scan(&result)// Raw SQLdb.Raw("SELECT name, age FROM users WHERE name = ?", "Antonio").Scan(&result Summary: If you don't look at the source code, you don't have to worry about it. It can be understood that find is the same as scan.
Note: Generally, when writing a joint table query, scan will be used
边栏推荐
猜你喜欢

Getting started with 3D modeling for games, what modeling software can I choose?

KT148A voice chip ic working principle and internal architecture description of the chip

10 种常见的BUG分类

【CVA估值训练营】财务建模指南——第一讲

The master teaches you the 3D real-time character production process, the game modeling process sharing

Huggingface入门篇 II (QA)

leetcode经典例题——单词拆分

【七夕情人节特效】-- canvas实现满屏爱心

Mysql_13 事务
![[230]连接Redis后执行命令错误 MISCONF Redis is configured to save RDB snapshots](/img/fa/5bdc81b1ebfc22d31f42da34427f3e.png)
[230]连接Redis后执行命令错误 MISCONF Redis is configured to save RDB snapshots
随机推荐
简单的顺序结构程序(C语言)
canvas 高斯模糊效果
LeetCode Hot 100
MAUI Blazor 权限经验分享 (定位,使用相机)
中日颜色风格
leetcode经典例题——单词拆分
什么是次世代建模(附学习资料)
手写分布式配置中心(1)
STC89C52RC的P4口的应用问题
D - I Hate Non-integer Number (选数的计数dp
【论文笔记】—低照度图像增强—Unsupervised—EnlightenGAN—2019-TIP
导入JankStats检测卡帧库遇到问题记录
gorm的Raw与scan
uinty lua 关于异步函数的终极思想
【七夕情人节特效】-- canvas实现满屏爱心
一、爬虫基本概念
[LeetCode] Summary of Matrix Simulation Related Topics
First, the basic concept of reptiles
SQL关联表更新
电子行业MES管理系统的主要功能与用途