v.io: v.io/v23/query/engine/public Index | Files

package public

import "v.io/v23/query/engine/public"

Package public defines the QueryEngine interface which is returned from calling v.io/v23/query/engine.Create and PreparedStatement which is returned from the QueryEngine.PrepareStatement function.

Index

Package Files

model.go

type PreparedStatement Uses

type PreparedStatement interface {
    // Exec executes the already prepared statement with the supplied parameter values.
    // The number of paramValues supplied must match the number of formal parameters
    // specified in the query (else NotEnoughParamValuesSpecified or
    // TooManyParamValuesSpecified errors are returned).
    Exec(paramValues ...*vom.RawBytes) ([]string, syncql.ResultStream, error)

    // Handle returns an int64 handle that can be passed to QueryEngine.GetPreparedStatement
    // function.  This is useful for modules implementing query support as they need
    // not keep track of prepared statements; rather, they can send the handle to the client
    // library and have the client keep track of the statement.  When it makes it back to
    // the server, QueryEngine.GetPreparedStatement(handle) can be used to reconstruct
    // the PreparedStatement.
    Handle() int64

    // Call close to free up the space taken by the PreparedStatement when no longer
    // needed.  If close is not called, the space will be freed when the containing
    // QueryEngine is garbage collected.
    Close()
}

type QueryEngine Uses

type QueryEngine interface {
    // Exec executes a syncQL query and returns the results. Headers (i.e., column
    // names) are returned separately from results (i.e., values).
    // q : the query (e.g., select v from Customers
    //               (e.g., delete from Customers where k = "101")
    Exec(q string) ([]string, syncql.ResultStream, error)

    // PrepareStatement parses query q and returns a PreparedStatement.  Queries passed to
    // PrepareStatement contain zero or more formal parameters (specified with a ?) for
    // operands in where clause expressions.
    // e.g., select k from Customer where Type(v) like ? and k like ?
    PrepareStatement(q string) (PreparedStatement, error)

    // Get an existing PreparedStatement from the int64 returned from calling
    // PreparedStatement.ToHandle.
    GetPreparedStatement(handle int64) (PreparedStatement, error)
}

Package public imports 2 packages (graph) and is imported by 16 packages. Updated 2018-08-24. Refresh now. Tools for package owners.