MindTouch Developer Center > Deki > Extensions > Microsoft SQL Server

Microsoft SQL Server

This extension only works on Windows.

This extension requires a trial or active MindTouch Deki Enterprise license.

 

This extension contains functions for displaying data from Microsoft SQL databases.  Related Links: Extension Overview, DekiScript Overview, Extension Demos.

Assembly: mindtouch.sqlserver
SID: sid://mindtouch.com/ent/2008/06/microsoft.sqlserver
License: Enterprise

This service requires Deki Wiki 8.08 or later.

To enable this extension, follow these steps:

  1. Go to Service management in the Control Panel of your wiki.
  2. Under Add Service, click on Local, and select type Extension.
  3. Enter a description and the extension SID: sid://mindtouch.com/ent/2008/06/microsoft.sqlserver
  4. Add any additional configuration settings that are required by the extension (see below).
  5. Click on add service.

Configuration:

Before the Microsoft SQL extension can be used, it must be configured with the access information to the database.

Config Key Description
db-server Optional. Database hostname or IP address. (default: "localhost")
db-catalog Database name.
db-user Database user name. (IMPORTANT: make sure user has read-only access!)
db-password Password for database user.
db-options Optional.  Connection string parameters. (default: none)

If you need to configure multiple databases for the same wiki, register this extension once for each database.  Use the following preference to specify a unique namespace value for each registration.  Invoke the service using this value instead of sql.  For example, if you set namespace=mydb1, you would invoke the service with mydb1.table("...") instead of sql.table("...").

Preference Description
namespace Specifies a custom namespace (default: sql)

Functions:


Sql.Table(query : str) : xml

Show results of a SELECT query in a sortable table.

Parameters:

Name Type Description
query str SELECT query.

Samples:

     Output

To embed a SELECT query that displays a list of all users in the users table:

{{ sql.table("SELECT user_name as Name, user_email as Email FROM users")  }} 
./MySql1.JPG

Sql.Value(query : str) : xml

Show single value from a SELECT query.

Parameters:

Name Type Description
query str SELECT query.

    


Sql.List(query : str, column : str) : xml

Collect rows as a list from a SELECT query.

Parameters:

Name Type Description
query str SELECT query.
column str Optional. Column name. (default: first column)

    


Sql.Record(query : str) : map

Collect all columns from a SELECT query.

Parameters:

Name Type Description
query str SELECT query.

    


Sql.RecordList(query : str) : list

Collect all columns and all rows from a SELECT query.

Parameters:

Name Type Description
query str SELECT query.

   

   

Tag page
Viewing 3 of 3 comments: view all
Hi

I get the following error:
MS SQL could not be restarted (where MS SQL is the name of the service)

and if I click "Show full report" i get the following:
Array
(
[title] => 500 Error
[message] =>
[response] => Request URI:
http://localhost:8081/deki/site/services/12/start?dream.out.format=php&dream.in.host=10.0.134.241&dream.in.scheme=http&dream.in.origin=10.2.1.96

Server response:
Array
(
[exception] => Array
(
[message] => unable to initialize service (invalid service-license)
[source] => mindtouch.dream
[stacktrace] => Array
(
[frame] => Array
(
[0] => MindTouch.Dream.DreamService+<CreateServiceAsync_Helper>d__19.MoveNext () [0x00000]
[1] => MindTouch.Dream.Coroutine.Iterate_Helper (IEnumerator`1 coroutine, MindTouch.Dream.TaskBehavior behavior) [0x00000]
[2] => System.VoidClosure`2[System.Collections.Generic.IEnumerator`1[MindTouch.Dream.IYield],MindTouch.Dream.TaskBehavior].Closure () [0x00000]
[3] => MindTouch.Dream.Task.Execute (System.VoidHandler handler, MindTouch.Dream.TaskBehavior behavior) [0x00000]
)

)

[type] => System.Exception
)

)

)

Can anyone help me?? edited 09:16, 17 Sep 2008
Posted 09:16, 17 Sep 2008
I received the same error message. I am running open source. Does this extension require Enterprise Edition?
Posted 01:52, 12 Oct 2008
Yes, it does.
Posted 19:31, 14 Nov 2008
Viewing 3 of 3 comments: view all
You must login to post a comment.
Powered by MindTouch Deki v.8.08.2