sqlite

package
v0.0.0-...-7a1a713 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2013 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrError      os.Error = Errno(1)   //    /* SQL error or missing database */
	ErrInternal   os.Error = Errno(2)   //    /* Internal logic error in SQLite */
	ErrPerm       os.Error = Errno(3)   //    /* Access permission denied */
	ErrAbort      os.Error = Errno(4)   //    /* Callback routine requested an abort */
	ErrBusy       os.Error = Errno(5)   //    /* The database file is locked */
	ErrLocked     os.Error = Errno(6)   //    /* A table in the database is locked */
	ErrNoMem      os.Error = Errno(7)   //    /* A malloc() failed */
	ErrReadOnly   os.Error = Errno(8)   //    /* Attempt to write a readonly database */
	ErrInterrupt  os.Error = Errno(9)   //    /* Operation terminated by sqlite3_interrupt()*/
	ErrIOErr      os.Error = Errno(10)  //    /* Some kind of disk I/O error occurred */
	ErrCorrupt    os.Error = Errno(11)  //    /* The database disk image is malformed */
	ErrFull       os.Error = Errno(13)  //    /* Insertion failed because database is full */
	ErrCantOpen   os.Error = Errno(14)  //    /* Unable to open the database file */
	ErrEmpty      os.Error = Errno(16)  //    /* Database is empty */
	ErrSchema     os.Error = Errno(17)  //    /* The database schema changed */
	ErrTooBig     os.Error = Errno(18)  //    /* String or BLOB exceeds size limit */
	ErrConstraint os.Error = Errno(19)  //    /* Abort due to constraint violation */
	ErrMismatch   os.Error = Errno(20)  //    /* Data type mismatch */
	ErrMisuse     os.Error = Errno(21)  //    /* Library used incorrectly */
	ErrNolfs      os.Error = Errno(22)  //    /* Uses OS features not supported on host */
	ErrAuth       os.Error = Errno(23)  //    /* Authorization denied */
	ErrFormat     os.Error = Errno(24)  //    /* Auxiliary database format error */
	ErrRange      os.Error = Errno(25)  //    /* 2nd parameter to sqlite3_bind out of range */
	ErrNotDB      os.Error = Errno(26)  //    /* File opened that is not a database file */
	Row                    = Errno(100) //   /* sqlite3_step() has another row ready */
	Done                   = Errno(101) //   /* sqlite3_step() has finished executing */
)

Functions

func GetFile

func GetFile(fd int) (file *os.File)

func GoFileClose

func GoFileClose(fd C.int) int

Returns 0 on success and -1 on error.

func GoFileFileSize

func GoFileFileSize(fd C.int) (rv int, size C.long)

return[0]: 0 on success and -1 on error. return[1]: size

func GoFileRead

func GoFileRead(fd C.int, dst *C.char, n C.int, offset C.long) (rv int)

Returns SQLite error code to be returned by xRead:

SQLITE_OK: read n bytes
SQLITE_IOERR_READ: got error while reading
SQLITE_IOERR_SHORT_READ: read fewer than n bytes; rest will be zeroed

func GoFileWrite

func GoFileWrite(fd C.int, src *C.char, n C.int, offset C.long) (rv int)

Returns SQLite error code to be returned by xWrite:

SQLITE_OK: wrote n bytes
SQLITE_IOERR_WRITE: got error while writing
SQLITE_FULL: partial write

func GoVFSAccess

func GoVFSAccess(filename *C.char, flags C.int) (rv int)

func GoVFSCurrentTimeInt64

func GoVFSCurrentTimeInt64() (now int64)

func GoVFSDelete

func GoVFSDelete(filename *C.char, syncDir C.int) (rv int)

Returns SQLite error code to be returned by xWrite:

SQLITE_OK: deleted the file
SQLITE_IOERR_DELETE: failed to delete
SQLITE_IOERR_DIR_FSYNC: failed to fsync dir after deleting

func GoVFSOpen

func GoVFSOpen(filename *C.char, flags C.int) (fd int)

fd is -1 on error.

func Version

func Version() string

Types

type Conn

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

func Open

func Open(filename string) (*Conn, os.Error)

func (*Conn) Close

func (c *Conn) Close() os.Error

func (*Conn) Exec

func (c *Conn) Exec(cmd string, args ...interface{}) os.Error

func (*Conn) Prepare

func (c *Conn) Prepare(cmd string) (*Stmt, os.Error)

type Errno

type Errno int

func (Errno) String

func (e Errno) String() string

type Stmt

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

func (*Stmt) Error

func (s *Stmt) Error() os.Error

func (*Stmt) Exec

func (s *Stmt) Exec(args ...interface{}) os.Error

func (*Stmt) Finalize

func (s *Stmt) Finalize() os.Error

func (*Stmt) Next

func (s *Stmt) Next() bool

func (*Stmt) Scan

func (s *Stmt) Scan(args ...interface{}) os.Error

Jump to

Keyboard shortcuts

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