
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
github.com/godoes/gorm-dameng
Advanced tools
基于达梦数据库官方 Go 驱动源码 二次开发整理的开箱即用的 GORM 达梦数据库驱动,无需单独复制驱动源码到项目中。 获取达梦最新官方 Go 驱动请访问 https://eco.dameng.com/download/。
go get -d github.com/godoes/gorm-dameng
package main
import (
"encoding/json"
"fmt"
"github.com/godoes/gorm-dameng"
"gorm.io/gorm"
)
func main() {
options := map[string]string{
"schema": "SYSDBA",
"appName": "GORM 连接达梦数据库示例",
"connectTimeout": "30000",
}
// dm://user:password@host:port?schema=SYSDBA[&...]
dsn := dameng.BuildUrl("user", "password", "127.0.0.1", 5236, options)
// VARCHAR 类型大小为字符长度
//db, err := gorm.Open(dameng.New(dameng.Config{DSN: dsn, VarcharSizeIsCharLength: true}))
// VARCHAR 类型大小为字节长度(默认)
db, err := gorm.Open(dameng.Open(dsn), &gorm.Config{})
if err != nil {
// panic error or log error info
}
// do somethings
var versionInfo []map[string]interface{}
db.Table("SYS.V$VERSION").Find(&versionInfo)
if err := db.Error; err == nil {
versionBytes, _ := json.MarshalIndent(versionInfo, "", " ")
fmt.Printf("达梦数据库版本信息:\n%s\n", versionBytes)
}
}
/****************** 控制台输出内容 *****************
达梦数据库版本信息:
[
{
"BANNER": "DM Database Server 64 V8"
},
{
"BANNER": "DB Version: 0x7000c"
},
{
"BANNER": "03134284094-20230927-******-*****"
}
]
*************************************************/
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.