gorm

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Importer

func Importer(_ context.Context, drv, dsn, schemaPath, daoPath *string, tables, _ []string) error

func ImporterFromGoSchema added in v1.0.4

func ImporterFromGoSchema(_ context.Context, dsn string, schemaPath, daoPath *string, includeTables []string) error

ImporterFromGoSchema 从 gorm model 源码目录(dsn 形如 gorm://<dir>)生成 DAO:解析模型 → 还原 MySQL DDL → gorm.io/rawsql 内存库 → gorm gen。 模型文件只在目标不存在时补齐,绝不覆盖已有用户模型。

func NewGormClient

func NewGormClient(drv, dsn string) (*gorm.DB, error)

NewGormClient 创建数据库客户端

func NewRawSqlClient

func NewRawSqlClient(sqlContent string) (*gorm.DB, error)

NewRawSqlClient 从 SQL 文本创建 gorm.DB(无需连接真实数据库) 适用于 gorm.io/gen 从建表语句生成模型

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL