Create a query builder for a data source. |
|
Create a query builder for a data source with given table alias. |
|
Get the column names of a datasource. |
|
Get the datasource string. |
|
Returns a foundset object for a specified datasource or server and tablename. |
|
An existing foundset under that name will be returned, or created if there is a definition (there is a form with a named foundset property with that name). |
|
Get a single record from a datasource. |
|
Get the table of a datasource. |
|
get a new foundset containing records based on a dataset of pks. |
|
get a new foundset containing records based on a QBSelect query. |
|
get a new foundset containing records based on an SQL query string. |
|
get a new foundset containing records based on an SQL query string with parameters. |
|
|
Create a query builder for a data source. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var q = datasources.db.example_data.book_nodes.createSelect()
q.result.addPk()
q.where.add(q.columns.label_text.not.isin(null))
datasources.db.example_data.book_nodes.getFoundSet().loadRecords(q) |
|
|
|
|
Create a query builder for a data source with given table alias.
The alias can be used inside custom queries to bind to the outer table. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var q = datasources.db.example_data.book_nodes.createSelect('b')
q.result.addPk()
q.where.add(q.columns.label_text.isin('select comment_text from book_text t where t.note_text = ? and t.node_id = b.node_id', ['test']))
datasources.db.example_data.book_nodes.getFoundSet().loadRecords(q) |
|
|
|
|
Get the column names of a datasource. |
|
|
Returns Array String[] column names |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
|
Get the datasource string. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample datasources.db.example_data.orders.getDataSource() // returns 'db:/example_data/orders' |
|
|
|
|
Returns a foundset object for a specified datasource or server and tablename.
It is important to note that this is a FACTORY method, it constantly creates new foundsets. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var fs = datasources.db.example_data.orders.getFoundSet()
var ridx = fs.newRecord()
var record = fs.getRecord(ridx)
record.emp_name = 'John'
databaseManager.saveData() |
|
|
|
|
An existing foundset under that name will be returned, or created if there is a definition (there is a form with a named foundset property with that name).
If named foundset datasource does not match current datasource will not be returned (will return null instead). |
|
|
Parameters The named foundset to get for this datasource. |
|
|
|
|
Returns JSFoundSet An existing named foundset for the datasource. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var fs = datasources.db.example_data.orders.getFoundSet('myname')
var ridx = fs.newRecord()
var record = fs.getRecord(ridx)
record.emp_name = 'John'
databaseManager.saveData() |
|
|
|
|
Get a single record from a datasource.
For the sake of performance, if more records are needed,
don't call this method in a loop but try using other methods instead. |
|
|
Parameters The primary key of the record to be retrieved. Can be an array, in case of a composite pk. |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var detailsRecord = datasources.db.example_data.order_details.getRecord([10248, 11])
var orderRecord = datasources.db.example_data.orders.getRecord(10248)
var customerRecord = datasources.db.example_data.customers.getRecord('ANATR') |
|
|
|
|
Get the table of a datasource. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
|
get a new foundset containing records based on a dataset of pks. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var fs = datasources.db.example_data.customers.loadRecords(pkDataSet) |
|
|
|
|
get a new foundset containing records based on a QBSelect query. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var qb = datasources.db.example_data.orders.createSelect();
qb.result.add(qb.columns.orderid);
var fs = datasources.db.example_data.orders.loadRecords(qb); |
|
|
|
|
get a new foundset containing records based on an SQL query string. |
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var query = "SELECT * FROM public.orders WHERE customerid = 'ROMEY' ORDER BY orderid ASC";
var fs = datasources.db.example_data.orders.loadRecords(query); |
|
|
|
|
get a new foundset containing records based on an SQL query string with parameters. |
|
|
Parameters an SQL query string with parameter placeholders |
|
an array of arguments for the query string |
|
|
|
|
Supported Clients SmartClient,WebClient,NGClient |
|
|
Sample var query = "SELECT * FROM public.orders WHERE customerid = ? OR customerid = ? order by orderid asc";
var args = ['ROMEY', 'BERGS'];
var fs = datasources.db.example_data.orders.loadRecords(query, args); |
|
|
|
|
|
|