query

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const AddValidationSession = `insert into
    threepid_validation_sessions (medium, address, clientSecret, mtime)
values
    ($1, $2, $3, $4) RETURNING id;`
View Source
const CreateTMPMxid = `` /* 182-byte string literal not displayed */
View Source
const CreateTokenSession = `insert into
    threepid_token_auths (validationSession, token, sendAttemptNumber)
values
    ($1, $2, $3)`
View Source
const GetAllPeers = `` /* 167-byte string literal not displayed */
View Source
const GetAssociationsAfterId = `` /* 174-byte string literal not displayed */
View Source
const GetLocal3pid = `SELECT
    COUNT(*)
FROM
    local_threepid_associations
WHERE
    medium = $1
    AND address = $2
    AND mxid = $3;`
View Source
const GetPeerByName = `` /* 187-byte string literal not displayed */
View Source
const GetSenderForToken = `SELECT
    sender
FROM
    invite_tokens
WHERE
    token = $1;`
View Source
const GetSessionByID = `` /* 138-byte string literal not displayed */
View Source
const GetTokenSession = `` /* 308-byte string literal not displayed */
View Source
const GetTokenSessionByID = `` /* 256-byte string literal not displayed */
View Source
const GetTokens = `` /* 163-byte string literal not displayed */
View Source
const GlobalAddAssociation = `` /* 265-byte string literal not displayed */
View Source
const GlobalGetMxid = `` /* 189-byte string literal not displayed */
View Source
const GlobalGetMxids = `` /* 332-byte string literal not displayed */
View Source
const GlobalLastIDFromServer = `SELECT
    max(originId),
    count(originId)
FROM
    global_threepid_associations
WHERE
    originServer = $1;`
View Source
const GlobalRemoveAssociation = `DELETE FROM
    global_threepid_associations
WHERE
    medium = $1
    AND address = $2`
View Source
const LocalAddOrUpdateAssociation = `` /* 356-byte string literal not displayed */
View Source
const LocalRemoveAssociation = `` /* 362-byte string literal not displayed */
View Source
const MarkTokensAsSent = `UPDATE
    invite_tokens
SET
    sent_ts = $1
WHERE
    medium = $2
    AND address = $3;`
View Source
const SetLastSentVersionAndPokeSucceeded = `update
    peers
set
    lastSentVersion = $1,
    lastPokeSucceededAt = $2
WHERE
    name = $3;`
View Source
const SetMtime = `update
    threepid_validation_sessions
set
    mtime = $1
WHERE
    id = $2;`
View Source
const SetSendAttemptNumber = `update
    threepid_token_auths
set
    sendAttemptNumber = $1
WHERE
    id = $2`
View Source
const SetValidated = `update
    threepid_validation_sessions
set
    validated = $1
WHERE
    id = $2;`
View Source
const SignedAssociationStringForThreepid = `` /* 192-byte string literal not displayed */
View Source
const StoreEphemeralPublicKey = `INSERT INTO
    ephemeral_public_keys (public_key, persistence_ts)
VALUES
    ($1, $2);`
View Source
const StoreToken = `INSERT INTO
invite_tokens (
	medium,
	address,
	room_id,
	sender,
	token,
	received_ts
)
VALUES
($1, $2, $3, $4, $5, $6);`
View Source
const ValidateEphemeralPublicKey = `UPDATE
    ephemeral_public_keys
SET
    verify_count = verify_count + 1
WHERE
    public_key = $1;`

Variables

This section is empty.

Functions

func Param

func Param(idx int) string

Types

type SQL

type SQL struct {
	// contains filtered or unexported fields
}

SQL implements models.SQL interface based on *sql.DB adding instrumentation and logging.

func New

func New(db *sql.DB) *SQL

func (*SQL) BeginTx

func (s *SQL) BeginTx(ctx context.Context, opts *sql.TxOptions) (models.Tx, error)

func (*SQL) ExecContext

func (s *SQL) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (*SQL) QueryContext

func (s *SQL) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

func (*SQL) QueryRowContext

func (s *SQL) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row

type Tx

type Tx struct {
	// contains filtered or unexported fields
}

func (*Tx) Commit

func (t *Tx) Commit() error

func (*Tx) ExecContext

func (t *Tx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (*Tx) QueryContext

func (t *Tx) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

func (*Tx) QueryRowContext

func (t *Tx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row

func (*Tx) Rollback

func (t *Tx) Rollback() error

Jump to

Keyboard shortcuts

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