Ai
1 Star 0 Fork 0

player1/restful-api-demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
sql.go 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
package impl
const (
InsertResourceSQL = `
INSERT INTO resource (
id,
vendor,
region,
create_at,
expire_at,
type,
name,
description,
status,
update_at,
sync_at,
accout,
public_ip,
private_ip
)
VALUES
(?,?,?,?,?,?,?,?,?,?,?,?,?,?);
`
// INSERT INTO `host` ( resource_id, cpu, memory, gpu_amount, gpu_spec, os_type, os_name, serial_number )
// VALUES
// ( "111", 1, 2048, 1, 'n', 'linux', 'centos8', '00000' );
InsertDescribeSQL = `
INSERT INTO host ( resource_id, cpu, memory, gpu_amount, gpu_spec, os_type, os_name, serial_number )
VALUES
( ?,?,?,?,?,?,?,? );
`
queryHostSQL = `SELECT r.id, r.name, r.description FROM resource as r LEFT JOIN host h ON r.id=h.resource_id`
queryHostAllSQL = `SELECT r.*, h.cpu, h.memory, h.gpu_amount, h.gpu_spec, h.os_type, h.os_name, h.serial_number FROM resource as r LEFT JOIN host h ON r.id=h.resource_id`
updateHostResourceSQL = `UPDATE resource SET vendor=?,region=?,expire_at=?,name=?,description=? WHERE id = ?`
updateHostDescribeSQL = `UPDATE host SET cpu=?,memory=? WHERE resource_id = ?`
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/player1111/restful-api-demo.git
git@gitee.com:player1111/restful-api-demo.git
player1111
restful-api-demo
restful-api-demo
19fd67857982

搜索帮助