mapper

package module
v0.0.0-...-064e8c6 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2017 License: MIT Imports: 2 Imported by: 0

README

xorm inflector mapper

Vexor status

Package implements Xorm IMapper that pluralizes table names

Installation

Just use go get.

go get github.com/humaniq/xorm-inflector-mapper

And then just import the package into your own code.

import (
    "github.com/humaniq/xorm-inflector-mapper"
)

Usage

You should use InflectorMapper with other Xorm mappers:

engine.SetTableMapper(mapper.NewInflectorMapper(SnakeMapper{}))

Pull requests policy

tl;dr. Contributions are welcome.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InflectorMapper

type InflectorMapper struct {
	Mapper core.IMapper
}

func NewInflectorMapper

func NewInflectorMapper(mapper core.IMapper) InflectorMapper

func (InflectorMapper) Obj2Table

func (mapper InflectorMapper) Obj2Table(name string) string

func (InflectorMapper) Table2Obj

func (mapper InflectorMapper) Table2Obj(name string) string

Jump to

Keyboard shortcuts

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