readeef: github.com/urandom/readeef/content/repo/sql/db Index | Files | Directories

package db

import "github.com/urandom/readeef/content/repo/sql/db"

Index

Package Files

db.go helper.go

func Register Uses

func Register(driver string, helper Helper)

type ArticleStmts Uses

type ArticleStmts struct {
    Create string
    Update string

    GetUserlessTemplate      string
    GetTemplate              string
    CountTemplate            string
    CountUserFeedsJoin       string
    StateReadColumn          string
    StateUnreadJoin          string
    StateFavoriteJoin        string
    GetIDsTemplate           string
    DeleteStaleUnreadRecords string
    GetScoreJoin             string
    GetUntaggedJoin          string

    ReadStateInsertTemplate     string
    ReadStateDeleteTemplate     string
    FavoriteStateInsertTemplate string
    FavoriteStateDeleteTemplate string
}

type DB Uses

type DB struct {
    *sqlx.DB
    // contains filtered or unexported fields
}

func New Uses

func New(log log.Log) *DB

func (*DB) CreateWithID Uses

func (db *DB) CreateWithID(tx *sqlx.Tx, sql string, arg interface{}) (int64, error)

func (*DB) Open Uses

func (db *DB) Open(driver, connect string) (err error)

func (DB) SQL Uses

func (db DB) SQL() SqlStmts

Can't recover from missing driver or statement, panic

func (*DB) WhereMultipleORs Uses

func (db *DB) WhereMultipleORs(column, prefix string, length int, equal bool) string

func (*DB) WithNamedStmt Uses

func (db *DB) WithNamedStmt(query string, tx *sqlx.Tx, cb func(*sqlx.NamedStmt) error) error

func (*DB) WithStmt Uses

func (db *DB) WithStmt(query string, tx *sqlx.Tx, cb func(*sqlx.Stmt) error) error

func (*DB) WithTx Uses

func (db *DB) WithTx(cb func(*sqlx.Tx) error) error

type ExtractStmts Uses

type ExtractStmts struct {
    Get    string
    Create string
    Update string
}

type FeedStmts Uses

type FeedStmts struct {
    Get          string
    GetByLink    string
    GetForUser   string
    All          string
    AllForUser   string
    AllForTag    string
    Unsubscribed string

    IDs    string
    Create string
    Update string
    Delete string

    GetUsers       string
    Attach         string
    Detach         string
    CreateUserTag  string
    DeleteUserTags string
}

type Helper Uses

type Helper interface {
    SQL() SqlStmts
    InitSQL() []string

    CreateWithID(tx *sqlx.Tx, sql string, arg interface{}) (int64, error)
    Upgrade(db *DB, old, new int) error

    WhereMultipleORs(string, string, int, bool) string
}

type ScoresStmts Uses

type ScoresStmts struct {
    Get    string
    Create string
    Update string
}

type SqlStmts Uses

type SqlStmts struct {
    Article      ArticleStmts
    Extract      ExtractStmts
    Feed         FeedStmts
    Scores       ScoresStmts
    Subscription SubscriptionStmts
    Tag          TagStmts
    Thumbnail    ThumbnailStmts
    User         UserStmts
}

type SubscriptionStmts Uses

type SubscriptionStmts struct {
    GetForFeed string
    All        string

    Create string
    Update string
}

type TagStmts Uses

type TagStmts struct {
    Get            string
    GetByValue     string
    AllForUser     string
    AllForFeed     string
    Create         string
    GetUserFeedIDs string
    DeleteStale    string
}

type ThumbnailStmts Uses

type ThumbnailStmts struct {
    Get    string
    Create string
    Update string
}

type UserStmts Uses

type UserStmts struct {
    Get         string
    GetByMD5API string
    All         string

    Create string
    Update string
    Delete string
}

Directories

PathSynopsis
base
postgres
sqlite3

Package db imports 9 packages (graph) and is imported by 4 packages. Updated 2018-10-05. Refresh now. Tools for package owners.