com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_link3' is unknown.

Custom Datasources

Custom datasources allow you to interface data services with any data storage type of your choice.

You can get the Add New Datasource screen shown below on the management console by executing steps 1 to 3 in creating a data service. Then, select Custom as the Datasource Type. It opens custom options as shown below:


Custom tabular data sources

Used to represent data in tables, where a set of named tables contains data rows that can be queried later.

You can use the interface org.wso2.carbon.dataservices.core.custom.datasource.TabularDataBasedDS to implement tabular data sources. For a sample implementation of a tabular custom data source, see InMemoryDataSource.

A tabular data source is typically associated with an SQL data services query. This is done by internally using our own SQL parser to execute SQL against the custom data source. For a a sample data service descriptor on how this is done, see InMemoryDSSample. Also, this is supported in Carbon data sources with the data source reader implementation org.wso2.carbon.dataservices.core.custom.datasource.CustomTabularDataSourceReader. Find a sample Carbon data source configuration file at <PRODUCT_HOME>/repository/conf/datasources/custom-datasources.xml.

Custom query data sources

Used when the data source has some form of a query expression support.

Custom query data sources are implemented using the interface org.wso2.carbon.dataservices.core.custom.datasource.CustomQueryBasedDS. You can create any non-tabular data source using the query-based approach. Even if the target data source does not have a query expression format, you can create your own. For example, you can support any NoSQL type data source this way.

For a sample implementation of a query-based custom data source, see EchoDataSource. For a sample data service descriptor with custom query data sources, see InMemoryDSSample. This is supported in Carbon data sources, with the data source reader implementation org.wso2.carbon.dataservices.core.custom.datasource.CustomQueryDataSourceReader. You can find a sample of a Carbon data source configuration in <PRODUCT_HOME>\repository\conf\datasources\custom-datasources.xml.

In the init methods of all custom data sources, user-supplied properties are parsed to initialize the data source accordingly. Also, a property named __DATASOURCE_ID__, which contains a UUID to uniquely identify the current data source, is passed. Custom data source authors use this to identify the data sources accordingly. For example, scenarios like data source instances communicating within a server cluster for data synchronization.

INFO: Find the custom connectors used in WSO2 DSS from the Github project located at https://github.com/wso2/wso2-dss-connectors.

To write a query to this data source, see Writing Data Service Queries.

com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.