当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
【unity编译器扩展之模型动画拷贝】
入门3D游戏建模师知识必备
The applicable scenarios and common product types of the KT148A electronic voice chip ic solution
[230]连接Redis后执行命令错误 MISCONF Redis is configured to save RDB snapshots
KT148A电子语音芯片ic方案适用的场景以及常见产品类型
GO中sync包自由控制并发的方法
【LeetCode】图解 904. 水果成篮
【云原生--Kubernetes】Pod控制器
KT6368A蓝牙的认证问题_FCC和BQB_CE_KC认证或者其它说明
typeScript - Partially apply a function
【idea】idea配置sql格式化
Getting started with 3D modeling for games, what modeling software can I choose?
《WEB安全渗透测试》(28)Burp Collaborator-dnslog外带技术
00、数组及字符串常用的 API(详细剖析)
【云原生--Kubernetes】调度约束
First, the basic concept of reptiles
oracle创建用户以后的权限问题
游戏3D建模入门,有哪些建模软件可以选择?
oracle创建表空间
#yyds dry goods inventory #Switching equipment serious packet loss troubleshooting


![[Cloud Native--Kubernetes] Pod Controller](/img/e1/1a8cc82223f9a9be79ebbf1211e9a4.png)






