Datasources

(datasources)

Overview

Datasources in Servoy provide a structured way to interact with various types of data sources, such as database tables, in-memory tables, views, and stored procedures. These datasources are accessible through the datasources object and support dynamic code completion based on the solution’s data model, enabling efficient development.

Datasources include types like DBDataSource, MemDataSource, ViewDataSource, SPDataSource, and MenuDataSource, each catering to a specific use case. For example, db is used for server/table-based data sources, mem for in-memory tables, and view for view foundset data sources. Stored procedures are managed under the sp property, with server-side configuration enabling their use. The menu property handles menu-related datasources.

For details related to datasources, refer to the specific sections in the Servoy documentation:

DBDataSourceServer

Create In Memory DataSource

View Foundset Datasource

Returned Types

DBDataSource,MemDataSource,JSDataSource,JSConnectionDefinition,DBDataSourceServer,ViewDataSource,MenuDataSource,

Properties Summarized

Type
Name
Summary

Scope property for server/table based data sources.

Scope property for in-memory data sources.

Scope property for view foundset data sources.

Scope property for stored procedures.

Scope property for view foundset data sources.

Methods Summarized

Type
Name
Summary

Scope getter for a datasource node based on a JSFoundset/JSRecord/ViewFoundset/ViewRecord

Scope getter for a datasource node based on datasource string.

Properties Detailed

db

Scope property for server/table based data sources.

Type DBDataSource

Sample

datasources.db.example_data.orders

mem

Scope property for in-memory data sources.

Type MemDataSource

Sample

datasources.mem['myds']

Scope property for view foundset data sources.

Type MenuDataSource

Sample

datasources.view['myds']

sp

Scope property for stored procedures. This will list the stored procedures of server that have this property enabled (see server editor).

Type SPDataSource

Sample

datasources.sp.servername.mystoredproc();

view

Scope property for view foundset data sources.

Type ViewDataSource

Sample

datasources.view['myds']

Methods Detailed

get(datasource)

Scope getter for a datasource node based on a JSFoundset/JSRecord/ViewFoundset/ViewRecord

Parameters

Returns: JSDataSource a JSDataSource based on parameter

Sample

datasources.get(recordOrFoundset)

get(datasource)

Scope getter for a datasource node based on datasource string.

Parameters

Returns: JSDataSource a JSDataSource based on parameter

Sample

datasources.get(datasource)

Last updated