db

package
v0.0.0-...-3d4ee63 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2015 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Contains types for implementing the DB, DBResult and DBRow interfaces using JS objects Assumes that the JS version of 'Query()' returns a matrix of rows and columns.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSDB

type JSDB struct {
	O *js.Object
}

A new type that implements user.DB by using a Javascript object

func (JSDB) Query

func (jsdb JSDB) Query(query string, params ...interface{}) user.DBResult

Uses the 'Query()' function from the JS object and turns the result into a DBResult

type JSDBResult

type JSDBResult struct {
	O     *js.Object // An array of rows
	Index int        // The current row index
}

Implements the user.DBResult interface

func (*JSDBResult) NextRow

func (jsresult *JSDBResult) NextRow() user.DBRow

func (*JSDBResult) RowCount

func (jsresult *JSDBResult) RowCount() int

type JSDBRow

type JSDBRow struct {
	O *js.Object // An array of column values
}

Implements the user.DBRow interface

func (*JSDBRow) GetInt

func (jsrow *JSDBRow) GetInt(colnum int) int

func (*JSDBRow) GetString

func (jsrow *JSDBRow) GetString(colnum int) string

Jump to

Keyboard shortcuts

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