Skip to content
/ aorm Public
forked from moisespsena-go/aorm

The fantastic Advanced ORM library for Golang, aims to be developer friendly

License

Notifications You must be signed in to change notification settings

go-aorm/aorm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AORM

The fantastic Advanced ORM library for Golang, aims to be developer friendly.

This is a fork of GORM with improved performance and many other features.

go report card wercker status Join the chat at https://gitter.im/go-aorm/aorm Open Collective Backer Open Collective Sponsor MIT license GoDoc

Overview

  • Full-Featured ORM (almost)
  • Associations (Has One, Has Many, Belongs To, Many To Many, Polymorphism)
  • Hooks (Before/After Create/Save/Update/Delete/Find)
  • Preloading (eager loading)
  • Transactions
  • Composite Primary Key
  • SQL Builder
  • Auto Migrations
  • Logger
  • Extendable, write Plugins based on GORM callbacks
  • Every feature comes with tests
  • Developer Friendly
  • NEW: Inline model loader and auto loader
  • NEW: Null values scaner without Nullable Field
  • NEW: Log callbacks
  • NEW: After scanner callbacks
  • NEW: Binary ID (using bid.BID)
  • NEW: Index/Unique Index withe WHERE clause
  • NEW: Raw args binder
  • NEW: Custom arg binder by dialect
  • NEW: Custom arg valuer by dialect
  • NEW: POLYMORPHIC_VALUE tag: sql:"POLYMORPHIC_VALUE:user" or singular and plural: sql:"POLYMORPHIC_VALUE:user,users"
  • NEW: Dry Run db.DryRun().First(&user)
  • NEW: Model Struct Api: aorm.StructOf(&User{})
  • NEW: Model Struct callbacks
  • NEW: Model Struct interface: aorm.InstaceOf(&User{})
  • NEW: ID Api: aorm.IdOf(&User{ID:1})
  • NEW: Get executed query and args fmt.Println(db.First(&user).Query) or fmt.Println(db.DryRun().First(&user).Query)
  • NEW: Readonly fields with select query
  • NEW: Args and Query API db.First(&user, aorm.Query{"name = ?", []interface{}{"joe"}}) or your type implements aorm.Clauser
  • NEW: Money type
  • NEW: Email type
  • NEW: String Slice Type (Strings)
  • NEW: Gzb Type: Text with Gzip compression
  • NEW: Dynamic table namer
  • NEW: Attribute as table
  • NEW: Table name with auto prefix from basename of Type PkgPath
  • NEW: Index/Unique with $not_blank token.
  • NEW: ID Generator API: ID field type implements IDGenerator interface
  • NEW: Migrator: err := aorm.NewMigrator(db).Migrate()
  • NEW: Quote db object path: aorm.QuotePath(db.Dialect(), "public.users")
  • NEW: and more other changes...
  • NEW: Protect Sringer API: ProtectStringer. Default implemetations: ProtectedString and ProtectStringerImpl.

Drivers

  • NEW: Static SQL dynamic escapes and zeros from special characters:

    • SqlStringOpen: '«'
    • SqlStringClose: '»'
    • SqlZeroString: 'ø'
    • SqlZeroByteArray: 'Ø'

    EXAMPLE:

    sql := "SELECT * FROM users WHERE name = «moi» OR detail = ø OR recovery_binary_key = Ø"
    // postgres driver
    fmt.Println(db.Driver().PrepareSQL(sql))

    output: SELECT * FROM users WHERE name = 'moi' OR detail = '' OR recovery_binary_key = \x''

PostgreSQL Driver

  • NEW: BID Table Partition

Installation

WINDOWS NOTE: run these commands inside CygWin or Git Bash.

go get -u github.com/go-aorm/aorm
cd $GOPATH/github.com/go-aorm/aorm
go generate

GO DEP

If uses dep for manage your dependencies, runs:

cd YOUR_PROJECT_DIR
dep ensure -add github.com/go-aorm/aorm
cd vendor/github.com/go-aorm/aorm
go generate

Getting Started

Contributing

You can help to deliver a better GORM, check out things you can do

License

© Moises P. Sena, 2018~time.Now

Released under the MIT License

Related Projects

About

The fantastic Advanced ORM library for Golang, aims to be developer friendly

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%