Update godoc.

This commit is contained in:
go-jet 2019-07-16 12:17:27 +02:00
parent 6f5d25ea9f
commit 57added50a
7 changed files with 28 additions and 17 deletions

View file

@ -19,6 +19,7 @@ _Support for additional databases will be added in future jet releases._
- [Benefits](#benefits)
- [Dependencies](#dependencies)
- [Versioning](#versioning)
- [License](#license)
## Features
1) Type-safe SQL Builder
@ -30,7 +31,8 @@ _Support for additional databases will be added in future jet releases._
* UPDATE (SET, WHERE, RETURNING),
* DELETE (WHERE, RETURNING),
* LOCK (IN, NOWAIT)
2) Auto-generated Data Model types - Go struct mapped to database type (table or enum)
2) Auto-generated Data Model types - Go struct mapped to database type (table or enum), used to store
result of database queries.
3) Query execution with mapping to arbitrary destination structure - destination structure can be
created by combining auto-generated data model types.
@ -150,7 +152,7 @@ Note that every column has a type. String column `Language.Name` and `Category.N
string columns and expressions. `Actor.ActorID`, `FilmActor.ActorID`, `Film.Length` are integer columns
and can be compared only with integer columns and expressions.
__How get parametrized SQL query?__
__How to get parametrized SQL query?__
```go
query, args, err := stmt.Sql()
```
@ -524,10 +526,12 @@ To run the tests, additional dependencies are required:
- `github.com/pkg/profile`
- `gotest.tools/assert`
## Contributing
## Versioning
[SemVer](http://semver.org/) is used for versioning. For the versions available, see the [releases](https://github.com/go-jet/jet/releases).
## Licence
## License
Copyright 2019 Goran Bjelanovic
Licensed under the Apache License, Version 2.0.

View file

@ -103,7 +103,8 @@ func (c columnImpl) serialize(statement statementType, out *sqlBuilder, options
}
//------------------------------------------------------//
// Dummy type for select * AllColumns
// Redefined type to support list of columns as projection
type ColumnList []Column
// projection interface implementation
@ -131,7 +132,8 @@ func (cl ColumnList) serializeForProjection(statement statementType, out *sqlBui
return nil
}
// column interface implementation
// dummy column interface implementation
func (cl ColumnList) Name() string { return "" }
func (cl ColumnList) TableName() string { return "" }
func (cl ColumnList) setTableName(name string) {}

View file

@ -1,6 +1,5 @@
package jet
//------------------------------------------------------//
type ColumnBool interface {
BoolExpression
column
@ -37,6 +36,7 @@ func BoolColumn(name string) ColumnBool {
}
//------------------------------------------------------//
type ColumnFloat interface {
FloatExpression
column
@ -72,6 +72,7 @@ func FloatColumn(name string) ColumnFloat {
}
//------------------------------------------------------//
type ColumnInteger interface {
IntegerExpression
column
@ -106,6 +107,7 @@ func IntegerColumn(name string) ColumnInteger {
}
//------------------------------------------------------//
type ColumnString interface {
StringExpression
column
@ -140,6 +142,7 @@ func StringColumn(name string) ColumnString {
}
//------------------------------------------------------//
type ColumnTime interface {
TimeExpression
column
@ -207,6 +210,7 @@ func TimezColumn(name string) ColumnTimez {
}
//------------------------------------------------------//
type ColumnTimestamp interface {
TimestampExpression
column
@ -241,6 +245,7 @@ func TimestampColumn(name string) ColumnTimestamp {
}
//------------------------------------------------------//
type ColumnTimestampz interface {
TimestampzExpression
column
@ -275,6 +280,7 @@ func TimestampzColumn(name string) ColumnTimestampz {
}
//------------------------------------------------------//
type ColumnDate interface {
DateExpression
column

6
doc.go
View file

@ -1,3 +1,5 @@
//
/*
Package Jet is a framework for writing type-safe SQL queries for PostgreSQL in Go, with ability
to easily convert database query result to desired arbitrary structure.
*/
package jet

View file

@ -5,10 +5,8 @@ var autoGenWarningTemplate = `
// Code generated by go-jet DO NOT EDIT.
// Generated at {{now}}
//
// WARNING: Changes to this file may cause incorrect behavior and will be lost
// if the code is regenerated
//
// Licence under: https://github.com/go-jet/jet/blob/master/LICENSE
// WARNING: Changes to this file may cause incorrect behavior
// and will be lost if the code is regenerated
//
`

View file

@ -4,9 +4,9 @@ import "errors"
//----------- Logical operators ---------------//
// Returns a representation of "not expr"
func NOT(expr BoolExpression) BoolExpression {
return newPrefixBoolOperator(expr, "NOT")
// Returns negation of bool expression expr
func NOT(exp BoolExpression) BoolExpression {
return newPrefixBoolOperator(exp, "NOT")
}
func BIT_NOT(expr IntegerExpression) IntegerExpression {

View file

@ -5,7 +5,6 @@ type projection interface {
from(subQuery ExpressionTable) projection
}
// Dummy type for projection list
type ProjectionList []projection
func (cl ProjectionList) from(subQuery ExpressionTable) projection {