WireBootstrap
HomeDocsBuySupport
  • Introduction
  • Overview
  • Getting Started
  • Installation
  • Connecting to Data
    • Data Connectors
      • SQL Data
      • Custom Web Services
      • Local Data
      • Other Sources
    • Data Sources
    • Discovery
    • Building a Data Connector
  • Working With Queries
    • Select Queries
      • Query Extensions
    • Stored Procedures
    • Custom Web Services
    • Executing Queries
    • ORM
  • Writing Data
  • Updates
  • Deletes
  • Working with DataTables
    • Introduction
    • Filter and Sort
    • Select and Calculate
    • Joins
    • Rows
    • Columns
  • Working with DataSets
  • Introduction
  • Executing Queries
  • Transforms
  • Writing Data
  • Data Events
  • Working with Components
    • Introduction
    • Encapsulation
    • Configuration
      • Data
      • Events
      • Observables
      • Validation
      • Display
      • Vendor
      • Custom
    • Component
    • Web Frameworks
    • Building a Component
      • Hello World
      • Data Events
      • DataSets
  • Working With Data Events
    • Introduction
    • Event Basics
    • Event Data
    • Event Actions
  • Working with Themes
    • Introduction
    • Sample Data
    • Libraries
    • Pages
    • Building a Theme Project
  • Utilities
    • Formatting
    • Expressions
    • Collections
    • Spinners
    • Copy and Merge
    • Validation
    • Loading Assets
    • Service Calls
    • Download Files
    • Browser Location
    • Types
    • Promise
  • Reference
    • wire
      • wire.Collection
      • wire.download
      • wire.validate
    • wire.data
      • wire.data.DataEvent
      • wire.data.DataModel
      • wire.data.DataPromise
      • wire.data.DataSet
      • wire.data.DataSource
      • wire.data.DataTable
        • Columns
        • Rows
      • wire.data.StoredProcedure
      • wire.data.TableQuery
    • wire.ui
      • wire.ui.Component
      • wire.ui.validate
Powered by GitBook
On this page
  • Service Providers
  • Provider Key
  • Provider Config
  • Allow
  • TableQuery
  • Provider Extensions
  • Provider Config

Was this helpful?

  1. Connecting to Data

Data Connectors

PreviousInstallationNextSQL Data

Last updated 1 year ago

Was this helpful?

WireBootstrap connects to a data service using a Data Connector. The architecture of a data connector can be as simple as a JavaScript class that makes calls to a data service or as complicated as the which includes both server and client-side components in its architecture.

Visit for a list of available data connectors and their supporting data services available in WireBootstrap. If you are using a data service that is not supported today, it's easy to build your own service provider. Visit for details.

Service Providers

The client side of a data connector uses a JavaScript class called a service provider that translates queries into syntax understood by a specific data service.

Most client application code, including components, connect to data services through a object. In turn, a data source uses a service provider created specifically for the target data service in order to execute queries. Service providers send queries to the data service on behalf of a data source. When a service provider gets a response from the data service, it passes the response back to the data source. For those familiar with the Microsoft .NET framework, this relationship is similar to the one between ADO.NET and an OLE DB provider.

Provider Key

Service providers register themselves with the WireBootstrap framework using a unique key. Use this key as the first parameter to constructing a new data source class.

To create a new data source, pass the service provider key into the constructor along with the configuration for the data source.

The example below creates a new data source that will make calls to a custom web service to get data.

//
// Create a new data source object pointing to a custom account 
// web service at a relative Url location.
//
const accountService = new wire.data.DataSource("custom", {
    ServiceRoot: "./account"
});

Provider Config

When creating a data source, the second parameter to the constructor is it's configuration. Use the Provider property on this configuration to specify settings specific to a service provider.

const sampleDataSource = new wire.data.DataSource("local", {
    Provider: { 
        Json: {url: "../../data/sampleData.json" } 
    }
});

Allow

Service providers are able to tell consumers about the functionality they support through an allow property. Below is a list of the functionality that service providers can support. See the service provider documentation for details.

Name

Default

Description

delete

false

Allows deleting data from the data service.

discover

false

Provides a way to get entity, field listings, and other meta data from the data service.

storedProcedure

false

Allows executing SQL stored procedures in a relational database.

tableQuery

false

test

false

Allows testing a connection to a data service.

write

false

Allows writing data to a data service.

In the example below, service provider support for testing a connection to the data service is checked before actually testing the connection.

const accountService = new wire.data.DataSource("custom", {
    ServiceRoot: "./account"
});

if(accountService.allow().test)
   accountService.test(); 

TableQuery

If allow.tableQuery is set to false then the service provider does not support select queries against a data service. If set to true, the defaults below all apply for service provider support for this feature. If set to an object, each property will specify the details of how this feature is implemented in the service provider.

Name

Default

Description

orderBy

null

Order by sorts the data returned from a data service. This property determines how the order by clause in the select query operates within the data services. Setting this property to 1 means the order by clause only supports 1 field for sorting data. A value 2 means the order by clause supports multiple order by fields for sorting data. A value of 0 or null means the service provider does not support this feature.

groupBy

false

Group by aggregates metric data across entities or dimensions of the metrics. This boolean attribute determines whether this feature is support by a data service.

The following example checks for tableQuery support and then executes a query against the account data service for customer entities.

const accountService = new wire.data.DataSource("custom", {
    ServiceRoot: "./account"
});

if(accountService.allow().tableQuery) {
    const query = wire.data.select().from("customers");
    const table = accountService.exec(query);
    ...
}   

Provider Extensions

Service providers must implement a minimum number of methods in order to be used by a data source to execute queries against a data service. However, they are free to add additional functionality as well.

A service provider can be accessed directly from a data source using the serviceProvider method.

const accountService = new wire.data.DataSource("sp", {
    ServiceRoot: "https://sharepoint-server/mysite"
});

const user = await accountService.serviceProvider().getCurrentUser();

Provider Config

When creating a data source, the second parameter to the constructor is it's configuration. Use the Provider property on this configuration to specify settings specific to a service provider.

const sampleDataSource = new wire.data.DataSource("local", {
    Provider: { 
        Json: {url: "../../data/sampleData.json" } 
    }
});

The example below is the sample data source used in the being created using the local data service provider key specifying that data be sourced from a JSON file.

Allows select queries for two dimensional data using a the class. See for details.

In the example below, the service provider for the can return the current user as a native SharePoint object using the getCurrentUser method directly on the service provider.

The example below is the sample data source used in the being created using the local data service provider key specifying that data be sourced from a JSON file.

WireBootstrap Query Service
www.wirebootstrap.com
Building a Data Connector
DataSource
WireBootstrap Gentelella theme
WireBootstrap SharePoint Data Connector
WireBootstrap Gentelella theme
TableQuery
TableQuery