Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
SQLClause Struct Reference

A datatype for storing a clause used to query a database. More...

#include <sql_clause.h>

Public Member Functions

SQLClauseAllocateSQLClause (const char *key_s, const char *op_s, const char *value_s)
 Allocate a SQLClause. More...
 
void FreeSQLClause (SQLClause *clause_p)
 Free a SQLClause. More...
 
bool AddSQLClauseToByteBuffer (const SQLClause *clause_p, ByteBuffer *buffer_p)
 Add the string representing a SQLClause to a ByteBuffer to be used as a query. More...
 
bool AddSQLClausesToByteBuffer (LinkedList *clauses_p, ByteBuffer *buffer_p)
 Add the strings representing each of the SQLClauses stored on a LinkedList of SQLClauseNodes to a ByteBuffer to be used as a query. More...
 

Data Fields

char * sqlc_key_s
 The key to use. More...
 
char * sqlc_op_s
 The operator such as =, like, <, etc. More...
 
char * sqlc_value_s
 The value to use in the query. More...
 

Detailed Description

A datatype for storing a clause used to query a database.

Examples such as "foo=bar" would become

sqlc_key_s = "foo" sqlc_op_s = "=" sqlc_value_s = "bar"

and "band like spina%" would become

sqlc_key_s = "band" sqlc_op_s = "like" sqlc_value_s = "spina%"

Member Function Documentation

◆ AllocateSQLClause()

SQLClause * AllocateSQLClause ( const char *  key_s,
const char *  op_s,
const char *  value_s 
)

Allocate a SQLClause.

Parameters
key_sThe key for the underlying SQLClause.
op_sThe key for the underlying SQLClause.
value_sThe key for the underlying SQLClause.
Returns
the newly-allocated SQLClause or NULL upon error.

◆ FreeSQLClause()

void FreeSQLClause ( SQLClause clause_p)

Free a SQLClause.

Parameters
clause_pThe SQLClause to free.

◆ AddSQLClauseToByteBuffer()

bool AddSQLClauseToByteBuffer ( const SQLClause clause_p,
ByteBuffer buffer_p 
)

Add the string representing a SQLClause to a ByteBuffer to be used as a query.

Parameters
clause_pThe SQLClause.
buffer_pThe ByteBuffer to print the SQLClause to.
Returns
true if the SQLClause was printed successfully to the ByteBuffer, false otherwise

◆ AddSQLClausesToByteBuffer()

bool AddSQLClausesToByteBuffer ( LinkedList clauses_p,
ByteBuffer buffer_p 
)

Add the strings representing each of the SQLClauses stored on a LinkedList of SQLClauseNodes to a ByteBuffer to be used as a query.

Parameters
clauses_pThe LinkedList of SQLClauseNodes.
buffer_pThe ByteBuffer to print the SQLClause to.
Returns
true if the all SQLClauses on the list was printed successfully to the ByteBuffer, false otherwise

Field Documentation

◆ sqlc_key_s

char* sqlc_key_s

The key to use.

◆ sqlc_op_s

char* sqlc_op_s

The operator such as =, like, <, etc.

◆ sqlc_value_s

char* sqlc_value_s

The value to use in the query.


The documentation for this struct was generated from the following file: