A database defined in the Stonefield Query data dictionary is a logical database: it defines what tables belong to the database and the structure of those tables. A physical database is the actual database on disk. The logical database doesn't concern itself with connection information; those are issues for the physical database. For example, you may have both SQL Server and Microsoft Access versions of the same logical database; the Northwind sample database that comes with both of these is one such set of physical databases that have the same logical database structure.

A Database object in the Stonefield Query data dictionary contains information about a logical database. A DataSource object defines the connection information for a physical database.

Data engine plugins can be used to specify the list of data sources the user can query on. For example, your application may use a configuration file that lists the data sources and their connection settings. A data engine plugin can read the same configuration file to create the data sources Stonefield Query can access.

A data engine plugin implements the IStonefieldQueryDataEnginePlugin interface in Interfaces.dll and uses the StonefieldQueryDataEnginePlugin attribute. Your plugin needs references to the Collections, Enums, Interfaces, PluginManager, and System.ComponentModel.Composition assemblies (the first four are Stonefield Query assemblies and the latter is a .NET assembly). It may also need references to other Stonefield Query assemblies, depending on what the plugin does; these can be found in the SQWeb\bin folder.

Studio can generate the source code for a plugin for you; see the Generating Plugin Source Code topic for details.

IStonefieldQueryDataEnginePlugin

Here's the definition of IStonefieldQueryDataEnginePlugin:

using System;
using System.Diagnostics.Contracts;
using Stonefield.Query.ConnectionManagement;
 
namespace Stonefield.Query.Plugins
{
    /// <summary>
    /// The interface that Data Engine plugins must implement.
    /// </summary>
    public interface IStonefieldQueryDataEnginePlugin :
        IStonefieldQueryBasePlugin
    {
        /// <summary>
        /// Fills the specified collection with data sources the
        /// user can query on.
        /// </summary>
        bool GetDataSources(IDataSourceCollection dataSources);

        /// <summary>
        /// Returns the name of the current data source used for reports.
        /// </summary>
        string GetCurrentDataSource(IDataSourceCollection dataSources);
    }
}

(As with all plugins that derive from IStonefieldQueryBasePlugin, it also has an Application member; see the Plugins topic for information about Application.)

StonefieldQueryDataEnginePlugin

The StonefieldQueryDataEnginePlugin attribute on the plugin class has the usual set of parameters all plugin attributes do; see the Plugins topic for details. Here's an example:

[StonefieldQueryDataEnginePlugin("{FB22E1B5-9AA1-4CE1-9D16-AEFDF0FB6E6C}",
    "SampleDataEnginePlugin",
    PluginSource.Custom,
    Version = "1.0.0.0",
    ExecutionPriority = 5)]
public class SampleDataEnginePlugin :
    IStonefieldQueryDataEnginePlugin

Plugin methods

Data engine plugins have the following methods:

See Also

Plugins