salesforcedb

package module
v0.0.0-...-b5e3f14 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: MIT Imports: 9 Imported by: 0

README

go-salesforcedb

Golang Salesforce database driver conforming to the Go database/sql interface.

Usage

This is an implementation of Go's database/sql/driver interface. In order to use it, you need to import the package and use the database/sql API.

Only SELECT operations are supported.

import (
	"database/sql"
	"log"

	_ "github.com/MikeAlbertFleetSolutions/go-salesforcedb"
)

func main() {
	conn, err := sql.Open("salesforcedb", "testuser/password1/XkjHhusah@https://company.my.salesforce.com")
	if err != nil {
		log.Fatalf("%+v", err)
	}

	rows, err := conn.Query("select Name from Account")
	if err != nil {
		log.Fatalf("%+v", err)
	}
	defer rows.Close()

	...

}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

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

Conn is a salesforce connection

func (*Conn) Begin

func (c *Conn) Begin() (driver.Tx, error)

Begin not supported but satisfies the interface requirements

func (*Conn) Close

func (c *Conn) Close() error

Close closes the salesforce connection

func (*Conn) Ping

func (c *Conn) Ping(ctx context.Context) error

Ping NOP but satisfies the interface requirements

func (*Conn) Prepare

func (c *Conn) Prepare(query string) (driver.Stmt, error)

Prepare not supported but satisfies the interface requirements

func (*Conn) Query

func (c *Conn) Query(query string, args []driver.Value) (driver.Rows, error)

Query carries out the simpleforce query

type Rows

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

Rows structure to track results

func (*Rows) Close

func (rows *Rows) Close() error

Close closes the rows

func (*Rows) Columns

func (rows *Rows) Columns() []string

Columns returns the columns in the result set

func (*Rows) Next

func (rows *Rows) Next(dest []driver.Value) error

Next navigates to next row in resultset

Jump to

Keyboard shortcuts

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