wire.data.DataSource
Use the DataSource
class to create a connection to a data service.
Properties
Name | Type | Default | Description |
Ajax | object | null | Ajax options used by the data source service provider to make calls to the data service if using jQuery Ajax. |
Headers | object | null | Attached headers to the data service call. See Authentication for an example. |
Model | object | null | Optional wire.data.DataModel to be used by the data source. |
Provider | object | null | Configuration for the service provider used by the data source. This will be specific to the service provider. Visit Service Providers for details. |
ServiceRoot | string | null | URL end point for the data service used by the data source. |
Methods
Name | Description |
allow | Returned from the service provider. See Allow details below. |
cast | Static method that casts an object with the same data source properties into an instance of the |
delete | Deletes data from a data service. See Writing Data Deletes for details. |
deleteAsync | Deletes data from a data service. See Writing Data Deletes for details. |
exec | Executes a query in a data service. |
execAsync | Executes a query in a data service. |
getResponseTable | Call into the service provider to transform data returned from a data service into a DataTable. |
serviceProvider | Returns the service provider instance. Visit Service Providers for details. |
test | Service provider must set allow().test for consumers to be sure testing the data service is supported. |
useBasicAuth | Tells the service provider to use Basic authentication when calling into the data service |
useBearerAuth | Tells the service provider to use Bearer authentication when calling into the data service |
write | Use this method to update data in a data service. See Writing Data Updates for details. |
writeAsync | Use this method to update data in a data service. See Writing Data Updates for details. |
Authentication
Use the Headers
property to attach headers to the data service call.
The example above uses a token with the Bearer
authentication. Below is an example that uses Basic
authentication with a user name and password.
Allow
The allow method exposes certain aspects of functionality available in the service provider.
Name | Type | Default | Description |
discover | boolean | false | Does the service provider allow meta data about data elements in the data service to be dynamically read. |
tableQuery | boolean | true | Does the service provider support building queries using TableQuery. |
tableQuery.orderBy | number | 0 | Does table query support include the |
tableQuery.groupBy | boolean | false | Does the service provider support the |
test | boolean | false | Does the service provider support testing data service availability. |
storedProcedure | boolean | false | Does the service provider support building queries using |
Discover Methods
Use the following methods to read meta data about the data contained in a data service.
All the discover methods take a singe options parameter. This parameter will be specific to the service provider if applicable at all. See DataSource Discovery for examples. Visit the service provider documentation for details on discovery options.
Name | Description |
discoverCatalogs | Returns the list of catalogs or databases from a data service using a synchronous call. |
discoverCatalogsAsync | Returns the list of catalogs or databases from a data service using an asynchronous call. |
discoverEntities | Returns the list of entities or tables from the database defined in the data service connection using a synchronous call. |
discoverEntitiesAsync | Returns the list of entities or tables from the database defined in the data service connection using an asynchronous call. |
discoverFields(config) | Returns the list of fields for an entity or table specified in |
discoverFieldsAsync(config) | Returns the list of fields for an entity or table specified in |
discoverProcedures | Returns the list of stored procedures from the database defined in the data service connection using a synchronous call. |
discoverProceduresAsync | Returns the list of stored procedures from the database defined in the data service connection using an asynchronous call. |
discoverProcedureParameters | Returns the list of parameters for a stored procedure specified in |
discoverProcedureParametersAsync(config) | Returns the list of parameters for a stored procedure specified in |
For more on data sources, visit Connecting to Data.
Last updated