Categorygithub.com/lunny/xorm
modulepackage
0.3.1
Repository: https://github.com/lunny/xorm.git
Documentation: pkg.go.dev

# README

中文

Xorm is a simple and powerful ORM for Go.

Build Status Go Walker Bitdeli Badge

Features

  • Struct <-> Table Mapping Support

  • Chainable APIs

  • Transaction Support

  • Both ORM and raw SQL operation Support

  • Sync database sechmea Support

  • Query Cache speed up

  • Database Reverse support, See Xorm Tool README

  • Simple cascade loading support

  • Optimistic Locking support

Drivers Support

Drivers for Go's sql package which currently support database/sql includes:

Changelog

  • v0.3.1

    Features:

    • Support MSSQL DB via ODBC driver (github.com/lunny/godbc);
    • Composite Key, using multiple pk xorm tag
    • Added Row() API as alternative to Iterate() API for traversing result set, provide similar usages to sql.Rows type
    • ORM struct allowed declaration of pointer builtin type as members to allow null DB fields
    • Before and After Event processors

    Improvements:

    • Allowed int/int32/int64/uint/uint32/uint64/string as Primary Key type
    • Performance improvement for Get()/Find()/Iterate()

More changelogs ...

Installation

If you have gopm installed,

gopm get github.com/lunny/xorm

Or

go get github.com/lunny/xorm

Documents

Cases

Todo

Todo List

Discuss

Please visit Xorm on Google Groups

Contributors

If you want to pull request, please see CONTRIBUTING

LICENSE

BSD License http://creativecommons.org/licenses/BSD/

# Packages

No description provided by the author
No description provided by the author

# Functions

new a db manager according to the parameter.
new an index.
No description provided by the author
No description provided by the author
No description provided by the author
NewNoneConnectPool new a NoneConnectPool.
No description provided by the author
NewSimpleConnectPool new a SimpleConnectPool.
No description provided by the author
NewSysConnectPool new a SysConnectPool.
default sql type change to go types.
No description provided by the author

# Constants

default cache expired time.
evey ten minutes to clear all expired nodes.
each time when gc to removed max nodes.
not use now.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

database column.
Engine is the major struct of xorm, it means a database manager.
IdFilter filter SQL replace (id) to primary key column name.
database index.
LRUCacher implements Cacher according to LRU algorithm.
MemoryStore implements CacheStore provide local machine memory store.
Struct NoneConnectPool is a implement for IConnectPool.
PgSeqFilter filter SQL replace ?, ? ..
provide prefix table name support.
QuoteFilter filter SQL replace ` to database's own quote character.
No description provided by the author
SameMapper implements IMapper and provides same name between struct and database table.
Struct Session keep a pointer to sql.DB and provides all execution of all kind of database operations.
Struct SimpleConnectPool is a simple implementation for IConnectPool.
SnakeMapper implements IMapper and provides name transaltion between struct and database table.
xorm SQL types.
statement save all the sql info for executing SQL.
provide suffix table name support.
Struct SysConnectPool is a simple wrapper for using system default connection pool.
database table.

# Interfaces

Executed after an object has been deleted.
Executed after an object is persisted to the database.
Executed after an object has been updated.
Executed before an object is deleted.
Executed before an object is initially persisted to the database.
Executed before an object is updated.
Cacher is an interface to provide cache.
CacheStore is a interface to store cache.
Conversion is an interface.
Filter is an interface to filter SQL.
Interface IConnecPool is a connection pool interface, all implements should implement Init, RetrieveDB, ReleaseDB and Close methods.
name translation between struct, fields names and table, column names.

# Type aliases

IterFunc only use by Iterate.
No description provided by the author