7f7b585ffb
- 在应用程序中新增对达梦数据库(DM)的配置和连接支持 - 实现 SetDmDB 函数以配置达梦数据库连接 - 更新数据库操作逻辑,支持达梦特有的 SQL 语法和功能 - 在相关文件中添加达梦数据库的处理逻辑,包括表创建、数据插入和查询 - 更新 go.mod 和 go.sum 文件以引入达梦数据库驱动 - 增强文档,详细说明达梦数据库的配置和使用方法
45 lines
919 B
Go
45 lines
919 B
Go
/*
|
|
* Copyright (c) 2000-2018, 达梦数据库有限公司.
|
|
* All rights reserved.
|
|
*/
|
|
|
|
package dm
|
|
|
|
type StructDescriptor struct {
|
|
m_typeDesc *TypeDescriptor
|
|
}
|
|
|
|
func newStructDescriptor(fulName string, conn *DmConnection) (*StructDescriptor, error) {
|
|
sd := new(StructDescriptor)
|
|
if fulName == "" {
|
|
return nil, ECGO_INVALID_COMPLEX_TYPE_NAME.throw()
|
|
}
|
|
|
|
sd.m_typeDesc = newTypeDescriptorWithFulName(fulName, conn)
|
|
|
|
err := sd.m_typeDesc.parseDescByName()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return sd, nil
|
|
}
|
|
|
|
func newStructDescriptorByTypeDescriptor(desc *TypeDescriptor) *StructDescriptor {
|
|
sd := new(StructDescriptor)
|
|
sd.m_typeDesc = desc
|
|
return sd
|
|
}
|
|
|
|
func (sd *StructDescriptor) getSize() int {
|
|
return sd.m_typeDesc.m_size
|
|
}
|
|
|
|
func (sd *StructDescriptor) getObjId() int {
|
|
return sd.m_typeDesc.m_objId
|
|
}
|
|
|
|
func (sd *StructDescriptor) getItemsDesc() []TypeDescriptor {
|
|
return sd.m_typeDesc.m_fieldsObj
|
|
}
|