1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 13:19:43 +02:00

Bump version to 5.11.0

This commit is contained in:
Harvey Kandola 2024-01-10 14:47:40 -05:00
parent a32510b8e6
commit 510e1bd0bd
370 changed files with 18825 additions and 5454 deletions

View file

@ -107,6 +107,11 @@ func (d1 Date) After(d2 Date) bool {
return d2.Before(d1)
}
// IsZero reports whether date fields are set to their default value.
func (d Date) IsZero() bool {
return (d.Year == 0) && (int(d.Month) == 0) && (d.Day == 0)
}
// MarshalText implements the encoding.TextMarshaler interface.
// The output is the result of d.String().
func (d Date) MarshalText() ([]byte, error) {
@ -175,6 +180,11 @@ func (t Time) IsValid() bool {
return TimeOf(tm) == t
}
// IsZero reports whether time fields are set to their default value.
func (t Time) IsZero() bool {
return (t.Hour == 0) && (t.Minute == 0) && (t.Second == 0) && (t.Nanosecond == 0)
}
// MarshalText implements the encoding.TextMarshaler interface.
// The output is the result of t.String().
func (t Time) MarshalText() ([]byte, error) {
@ -262,6 +272,11 @@ func (dt1 DateTime) After(dt2 DateTime) bool {
return dt2.Before(dt1)
}
// IsZero reports whether datetime fields are set to their default value.
func (dt DateTime) IsZero() bool {
return dt.Date.IsZero() && dt.Time.IsZero()
}
// MarshalText implements the encoding.TextMarshaler interface.
// The output is the result of dt.String().
func (dt DateTime) MarshalText() ([]byte, error) {

27
vendor/github.com/golang-sql/sqlexp/LICENSE generated vendored Normal file
View file

@ -0,0 +1,27 @@
Copyright (c) 2017 The Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

22
vendor/github.com/golang-sql/sqlexp/PATENTS generated vendored Normal file
View file

@ -0,0 +1,22 @@
Additional IP Rights Grant (Patents)
"This implementation" means the copyrightable works distributed by
Google as part of the Go project.
Google hereby grants to You a perpetual, worldwide, non-exclusive,
no-charge, royalty-free, irrevocable (except as stated in this section)
patent license to make, have made, use, offer to sell, sell, import,
transfer and otherwise run, modify and propagate the contents of this
implementation of Go, where such license applies only to those patent
claims, both currently owned or controlled by Google and acquired in
the future, licensable by Google that are necessarily infringed by this
implementation of Go. This grant does not include claims that would be
infringed only as a consequence of further modification of this
implementation. If you or your agent or exclusive licensee institute or
order or agree to the institution of patent litigation against any
entity (including a cross-claim or counterclaim in a lawsuit) alleging
that this implementation of Go or any code incorporated within this
implementation of Go constitutes direct or contributory patent
infringement, or inducement of patent infringement, then any patent
rights granted to you under this License for this implementation of Go
shall terminate as of the date such litigation is filed.

5
vendor/github.com/golang-sql/sqlexp/README.md generated vendored Normal file
View file

@ -0,0 +1,5 @@
# golang-sql exp
https://godoc.org/github.com/golang-sql/sqlexp
All contributions must have a valid golang CLA.

8
vendor/github.com/golang-sql/sqlexp/doc.go generated vendored Normal file
View file

@ -0,0 +1,8 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package sqlexp provides interfaces and functions that may be adopted into
// the database/sql package in the future. All features may change or be removed
// in the future.
package sqlexp // imports github.com/golang-sql/sqlexp

80
vendor/github.com/golang-sql/sqlexp/messages.go generated vendored Normal file
View file

@ -0,0 +1,80 @@
package sqlexp
import (
"context"
"fmt"
)
// RawMessage is returned from RowsMessage.
type RawMessage interface{}
// ReturnMessage may be passed into a Query argument.
//
// Drivers must implement driver.NamedValueChecker,
// call ReturnMessageInit on it, save it internally,
// and return driver.ErrOmitArgument to prevent
// this from appearing in the query arguments.
//
// Queries that recieve this message should also not return
// SQL errors from the Query method, but wait to return
// it in a Message.
type ReturnMessage struct {
queue chan RawMessage
}
// Message is called by clients after Query to dequeue messages.
func (m *ReturnMessage) Message(ctx context.Context) RawMessage {
select {
case <-ctx.Done():
return MsgNextResultSet{}
case raw := <-m.queue:
return raw
}
}
// ReturnMessageEnqueue is called by the driver to enqueue the driver.
// Drivers should not call this until after it returns from Query.
func ReturnMessageEnqueue(ctx context.Context, m *ReturnMessage, raw RawMessage) error {
select {
case <-ctx.Done():
return ctx.Err()
case m.queue <- raw:
return nil
}
}
// ReturnMessageInit is called by database/sql setup the ReturnMessage internals.
func ReturnMessageInit(m *ReturnMessage) {
m.queue = make(chan RawMessage, 15)
}
type (
// MsgNextResultSet must be checked for. When received, NextResultSet
// should be called and if false the message loop should be exited.
MsgNextResultSet struct{}
// MsgNext indicates the result set ready to be scanned.
// This message will often be followed with:
//
// for rows.Next() {
// rows.Scan(&v)
// }
MsgNext struct{}
// MsgRowsAffected returns the number of rows affected.
// Not all operations that affect rows return results, thus this message
// may be received multiple times.
MsgRowsAffected struct{ Count int64 }
// MsgLastInsertID returns the value of last inserted row. For many
// database systems and tables this will return int64. Some databases
// may return a string or GUID equivalent.
MsgLastInsertID struct{ Value interface{} }
// MsgNotice is raised from the SQL text and is only informational.
MsgNotice struct{ Message fmt.Stringer }
// MsgError returns SQL errors from the database system (not transport
// or other system level errors).
MsgError struct{ Error error }
)

73
vendor/github.com/golang-sql/sqlexp/mssql.go generated vendored Normal file
View file

@ -0,0 +1,73 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package sqlexp
import (
"context"
"database/sql/driver"
"fmt"
"strings"
)
type mssql struct{}
var (
_ DriverNamer = mssql{}
_ DriverQuoter = mssql{}
_ DriverSavepointer = mssql{}
)
func (mssql) Open(string) (driver.Conn, error) {
panic("not implemented")
}
func (mssql) Namer(ctx context.Context) (Namer, error) {
return sqlServerNamer{}, nil
}
func (mssql) Quoter(ctx context.Context) (Quoter, error) {
return sqlServerQuoter{}, nil
}
func (mssql) Savepointer() (Savepointer, error) {
return sqlServerSavepointer{}, nil
}
type sqlServerNamer struct{}
func (sqlServerNamer) Name() string {
return "sqlserver"
}
func (sqlServerNamer) Dialect() string {
return DialectTSQL
}
type sqlServerQuoter struct{}
func (sqlServerQuoter) ID(name string) string {
return "[" + strings.Replace(name, "]", "]]", -1) + "]"
}
func (sqlServerQuoter) Value(v interface{}) string {
switch v := v.(type) {
default:
panic("unsupported value")
case string:
return "'" + strings.Replace(v, "'", "''", -1) + "'"
}
}
type sqlServerSavepointer struct{}
func (sqlServerSavepointer) Release(name string) string {
return ""
}
func (sqlServerSavepointer) Create(name string) string {
return fmt.Sprintf("save tran %s;", name)
}
func (sqlServerSavepointer) Rollback(name string) string {
return fmt.Sprintf("rollback tran %s;", name)
}

59
vendor/github.com/golang-sql/sqlexp/namer.go generated vendored Normal file
View file

@ -0,0 +1,59 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package sqlexp
import (
"context"
"database/sql/driver"
"errors"
"reflect"
)
const (
DialectPostgres = "postgres"
DialectTSQL = "tsql"
DialectMySQL = "mysql"
DialectSQLite = "sqlite"
DialectOracle = "oracle"
)
// Namer returns the name of the database and the SQL dialect it
// uses.
type Namer interface {
// Name of the database management system.
//
// Examples:
// "posgresql-9.6"
// "sqlserver-10.54.32"
// "cockroachdb-1.0"
Name() string
// Dialect of SQL used in the database.
Dialect() string
}
// DriverNamer may be implemented on the driver.Driver interface.
// It may need to request information from the server to return
// the correct information.
type DriverNamer interface {
Namer(ctx context.Context) (Namer, error)
}
// NamerFromDriver returns the DriverNamer from the DB if
// it is implemented.
func NamerFromDriver(d driver.Driver, ctx context.Context) (Namer, error) {
if q, is := d.(DriverNamer); is {
return q.Namer(ctx)
}
dv := reflect.ValueOf(d)
d, found := internalDrivers[dv.Type().String()]
if found {
if q, is := d.(DriverNamer); is {
return q.Namer(ctx)
}
}
return nil, errors.New("namer not found")
}

67
vendor/github.com/golang-sql/sqlexp/pg.go generated vendored Normal file
View file

@ -0,0 +1,67 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package sqlexp
import (
"context"
"database/sql/driver"
"fmt"
)
type postgresql struct{}
var (
_ DriverNamer = postgresql{}
_ DriverQuoter = postgresql{}
_ DriverSavepointer = postgresql{}
)
func (postgresql) Open(string) (driver.Conn, error) {
panic("not implemented")
}
func (postgresql) Namer(ctx context.Context) (Namer, error) {
return pgNamer{}, nil
}
func (postgresql) Quoter(ctx context.Context) (Quoter, error) {
panic("not implemented")
}
func (postgresql) Savepointer() (Savepointer, error) {
return pgSavepointer{}, nil
}
type pgNamer struct{}
func (pgNamer) Name() string {
return "postgresql"
}
func (pgNamer) Dialect() string {
return DialectPostgres
}
type pgQuoter struct{}
func (pgQuoter) ID(name string) string {
return ""
}
func (pgQuoter) Value(v interface{}) string {
return ""
}
type pgSavepointer struct{}
func (pgSavepointer) Release(name string) string {
return fmt.Sprintf("release savepoint %s;", name)
}
func (pgSavepointer) Create(name string) string {
return fmt.Sprintf("savepoint %s;", name)
}
func (pgSavepointer) Rollback(name string) string {
return fmt.Sprintf("rollback to savepoint %s;", name)
}

22
vendor/github.com/golang-sql/sqlexp/querier.go generated vendored Normal file
View file

@ -0,0 +1,22 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package sqlexp
import (
"context"
"database/sql"
)
// Querier is the common interface to execute queries on a DB, Tx, or Conn.
type Querier interface {
ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
}
var (
_ Querier = &sql.DB{}
_ Querier = &sql.Tx{}
)

57
vendor/github.com/golang-sql/sqlexp/quoter.go generated vendored Normal file
View file

@ -0,0 +1,57 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package sqlexp
import (
"context"
"database/sql/driver"
"errors"
"reflect"
)
// BUG(kardianos): Both the Quoter and Namer may need to access the server.
// Quoter returns safe and valid SQL strings to use when building a SQL text.
type Quoter interface {
// ID quotes identifiers such as schema, table, or column names.
// ID does not operate on multipart identifiers such as "public.Table",
// it only operates on single identifiers such as "public" and "Table".
ID(name string) string
// Value quotes database values such as string or []byte types as strings
// that are suitable and safe to embed in SQL text. The returned value
// of a string will include all surrounding quotes.
//
// If a value type is not supported it must panic.
Value(v interface{}) string
}
// DriverQuoter returns a Quoter interface and is suitable for extending
// the driver.Driver type.
//
// The driver may need to hit the database to determine how it is configured to
// ensure the correct escaping rules are used.
type DriverQuoter interface {
Quoter(ctx context.Context) (Quoter, error)
}
// QuoterFromDriver takes a database driver, often obtained through a sql.DB.Driver
// call or from using it directly to get the quoter interface.
//
// Currently MssqlDriver is hard-coded to also return a valided Quoter.
func QuoterFromDriver(d driver.Driver, ctx context.Context) (Quoter, error) {
if q, is := d.(DriverQuoter); is {
return q.Quoter(ctx)
}
dv := reflect.ValueOf(d)
d, found := internalDrivers[dv.Type().String()]
if found {
if q, is := d.(DriverQuoter); is {
return q.Quoter(ctx)
}
}
return nil, errors.New("quoter interface not found")
}

15
vendor/github.com/golang-sql/sqlexp/registry.go generated vendored Normal file
View file

@ -0,0 +1,15 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package sqlexp
import (
"database/sql/driver"
)
var internalDrivers = map[string]driver.Driver{
"*mssql.MssqlDriver": mssql{},
"*pq.Driver": postgresql{},
"*stdlib.Driver": postgresql{},
}

37
vendor/github.com/golang-sql/sqlexp/savepoint.go generated vendored Normal file
View file

@ -0,0 +1,37 @@
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package sqlexp
import (
"database/sql/driver"
"errors"
"reflect"
)
type Savepointer interface {
Release(name string) string
Create(name string) string
Rollback(name string) string
}
type DriverSavepointer interface {
Savepointer() (Savepointer, error)
}
// SavepointFromDriver
func SavepointFromDriver(d driver.Driver) (Savepointer, error) {
if q, is := d.(DriverSavepointer); is {
return q.Savepointer()
}
dv := reflect.ValueOf(d)
d, found := internalDrivers[dv.Type().String()]
if found {
if q, is := d.(DriverSavepointer); is {
return q.Savepointer()
}
}
return nil, errors.New("savepointer interface not found")
}