odbc

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package odbc provides facilities for odbc declarations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	XMLName xml.Name `xml:"bundle"`

	ID      string `xml:"id,attr"`
	Comment string `xml:",comment"`

	BundlesAndFields
}

type BundlesAndFields

type BundlesAndFields struct {
	Fields  []Field
	Bundles []Bundle
}

type Field

type Field struct {
	XMLName xml.Name `xml:"field"`

	ID string `xml:"id,attr"`

	Comment   string `xml:",comment"`
	FieldName string `xml:"fieldname"`
}

type Server

type Server struct {
	XMLName xml.Name `xml:"server"`

	URL      string `xml:"url"`
	Database string `xml:"database"`
	Port     int    `xml:"port"`
	User     string `xml:"user"`
	Password string `xml:"password"`

	Tables []Table `xml:"table"`
}

Server represents an odbc server implementation. It is the main interface to ODBC.

It can be passed to xml.Marshal and xml.Unmarshal.

func NewServer

func NewServer(pb pathbuilder.Pathbuilder) (s Server)

NewServer generates a new server from a pathbuilder

func (Server) TableByID

func (server Server) TableByID(mainBundleID string) Table

TableByID returns the table in this server with the provided main bundle id If no such table exists, returns an empty ODBCTable.

type Table

type Table struct {
	XMLName xml.Name `xml:"table"`

	Select string `xml:"select"`
	Name   string `xml:"name"`

	Append    string                `xml:"append"`
	Delimiter string                `xml:"delimiter"`
	ID        string                `xml:"id"`
	Trim      xmltypes.BoolAsString `xml:"trim"`

	Row struct {
		BundlesAndFields
	} `xml:"row"`
}

func (Table) MainBundleID

func (table Table) MainBundleID() string

MainBundleID returns the main bundle id corresponding to this table

Jump to

Keyboard shortcuts

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