schema_load (string inisection, string schema_name);
- loads a schema definition from the database
- the inisection contains the database connection parameters
- the schema name is self explanatory
- returns a schema handle used for succeeding function calls
schema_info (long handle);
- retrieve schema information in JSON format
- handle is the database handle returned by schema_load
- returns the formatted JSON string containing schema information
schema_numcols (long handle);
- get the number of schema columns
- handle is the database handle returned by schema_load
- the column count
schema_mapkey (long handle, bool validate, string suffix);
- Maps query arguments into schema primary key columns
- handle is the database handle returned by schema_load
- validate the query argument?
- the query parameter suffix (i.e. fieldname is 'age', suffix is '_add')
internally, the query parameter is retrieved as REQUEST ('age_add'); ?>
- returns true on success, false otherwise
schema_mapall (long handle, bool validate, string suffix);
- Maps query arguments into all schema columns
- handle is the database handle returned by schema_load
- validate the query argument?
- the query parameter suffix (i.e. fieldname is 'age', suffix is '_add')
internally, the query parameter is retrieved as REQUEST ('age_add'); ?>
- returns true on success, false otherwise
schema_mapsearch (long handle, string suffix);
- Maps query arguments into schema search columns
- handle is the database handle returned by schema_load
- the query parameter suffix (i.e. fieldname is 'age', suffix is '_search')
internally, the query parameter is retrieved as REQUEST ('age_search'); ?>
- returns true on success, false otherwise
schema_insert (long handle, bool commit);
- inserts a record to the database
- handle is the database handle returned by schema_load
- commit database changes?
- returns true on success, false otherwise
schema_update (long handle, bool commit);
- updates a database record
- handle is the database handle returned by schema_load
- commit database changes?
- returns true on success, false otherwise
schema_delete (long handle, bool commit);
- removes a database record
- handle is the database handle returned by schema_load
- commit database changes?
- returns true on success, false otherwise
schema_retrieve (long handle, int currentpage, int displayrows);
- selects records from the database
- handle is the database handle returned by schema_load
- current page number
- number of rows to display
- returns the result set in JSON string format
schema_search_value (long handle, column name or index);
- retrieves the value of a search column
- handle is the database handle returned by schema_load
- column name or index
- returns the string value
schema_getcol_value (long handle, column name or index);
- retrieves the value of a column
- handle is the database handle returned by schema_load
- column name or index
- returns the string value
Schema Method(s)
Functions provided to interact with schema data generated by the CYWare Schema web application. Schemas make it convenient to deal with data validation / persistence.
schema_load (string inisection, string schema_name);
- loads a schema definition from the database
- the inisection contains the database connection parameters
- the schema name is self explanatory
- returns a schema handle used for succeeding function calls
schema_info (long handle);
- retrieve schema information in JSON format
- handle is the database handle returned by schema_load
- returns the formatted JSON string containing schema information
schema_numcols (long handle);
- get the number of schema columns
- handle is the database handle returned by schema_load
- the column count
schema_mapkey (long handle, bool validate, string suffix);
- Maps query arguments into schema primary key columns
- handle is the database handle returned by schema_load
- validate the query argument?
- the query parameter suffix (i.e. fieldname is 'age', suffix is '_add')
internally, the query parameter is retrieved as
- returns true on success, false otherwise
schema_mapall (long handle, bool validate, string suffix);
- Maps query arguments into all schema columns
- handle is the database handle returned by schema_load
- validate the query argument?
- the query parameter suffix (i.e. fieldname is 'age', suffix is '_add')
internally, the query parameter is retrieved as
- returns true on success, false otherwise
schema_mapsearch (long handle, string suffix);
- Maps query arguments into schema search columns
schema_setsearch_value (long handle, column name or index, string value);
- sets the value of a search column
- handle is the database handle returned by schema_load
- column name or index
- the string value
- returns true on success
schema_setcol_value (long handle, column name or index, string value);
- sets the value of a column
- handle is the database handle returned by schema_load
- column name or index
- the string value
- returns true on success
| Function | Argument(s) | Type |
| schema_input_date |
int offset - the space offset of the input element. used for code readability. string column_name - the name of the column bool readonly - self explanatory string suffix - the input element suffix |
HTML string formatted input element |
| schema_input_time |
int offset - the space offset of the input element. used for code readability. string column_name - the name of the column bool readonly - self explanatory bool autofocus - receives the initial focus string suffix - the input element suffix |
HTML string formatted input element |
| schema_input_label |
int offset - the space offset of the input element. used for code readability. string column_name - the name of the column bool required - self explanatory bool readonly - self explanatory bool autofocus - receives the initial focus string input_type - the input element type (i.e. text, password, email etc...) string input_prompt - prompt (i.e. Enter your email) string suffix - the input element suffix |
HTML string formatted input element |
| schema_input_number |
int offset - the space offset of the input element. used for code readability. string column_name - the name of the column bool required - self explanatory bool readonly - self explanatory bool autofocus - receives the initial focus float step - increment value for the spin control string input_prompt - prompt (i.e. Enter your email) string suffix - the input element suffix |
HTML string formatted input element |
| schema_input_checkbox |
int offset - the space offset of the input element. used for code readability. string column_name - the name of the column bool readonly - self explanatory string suffix - the input element suffix |
HTML string formatted input element |