client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package client implements a client for the PostgreSQL through HTTP wpsql server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Log func(...interface{}) error
	*http.Client
	URL, DB, Secret string
}

Client is a wpsql client. URL must be the URL of the wpsql server. DB is the target database. Secretus needed for data modification only.

func (Client) Exec

func (m Client) Exec(ctx context.Context, qry string, params ...string) error

Exec a query.

func (Client) Query

func (m Client) Query(ctx context.Context, qry string, params ...string) ([][]string, error)

Query the database.

func (Client) QueryWalk added in v0.1.0

func (m Client) QueryWalk(ctx context.Context, callback func([]string) error, qry string, params ...string) error

QueryWalk calls the given callback for each row. It quits with the error if the callbacks returns an error.

Jump to

Keyboard shortcuts

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