Dataphor.org

D4Runner Command Line Utility

Modified: 2009/04/07 10:41 by n8allan - Categorized as: Documentation
D4Runner is a command-line utility that can be used to execute commands against a Dataphor Server. As with Dataphoria, the utility is capable of connecting to an existing Dataphor Server, or running an instance in-process. The following sections describe the basic functionality of D4Runner.

Edit

Parameters

A list of parameters can be obtained from the utility itself using the /? option:

D4Runner /?

D4Runner accepts the following parameters:

  • /AliasName:
The name of the alias to use to connect. If specified, this is used before the Host and Port options. The default value is an empty string. The short form of the parameter is /A.

If an alias name is provided, it must specify an alias that is present in the ServerAliases.config file. This file is located in the Alphora program data directory for machine-level aliases, and in the Alphora app data directory for user-level aliases.

  • /Host:
The address of the Dataphor Server specified as an IP address or a name. The default value is 'localhost'. The short form of the parameter is /H.

  • /Port:
The port of the Dataphor Server. The default value is (8061). The short form of the parameter is /P.

  • /File:
The name of a file containing the D4 script to be run. D4Runner can run a script from a file, or as a parameter on the command-line. Specifying the file will take precedence if a script is provided on the command line. The short form of the parameter is /F.

  • /User:
The User to login to the Dataphor Server. The default value is 'Admin'. The short form of the parameter is /U.

  • /Password:
The password to login to the Dataphor Server. The default value is ''.

  • /Quiet-
When set to true (+), indicates that extra information should not be displayed. The default value is (-). The short form of the parameter is /Q.

  • /Options: { None | ShowPrepareTime | ShowExecutionTime | ShowSuccessStatus | All }
Specifies the output options for statement-level execution. The default value is 'ShowSuccessStatus'. The short form of the parameter is /O.

  • /Prompt-
Determines whether or not to wait for a keystroke at the end of execution. Note that in Quiet mode, no prompt will be displayed indicating that a key is required. The default value is (-).

  • < Script >
The D4 script to run, specified as a string. Either the name of a file containing the D4 script to be run must be provided using the /File option, or the D4 script to be run must be provided with this parameter.

Edit

Connecting To An Existing Instance

To connect to a running Dataphor Server, the name (or ip address) of the machine hosting the instance must be provided, as well as the port number on which the server is listening. The default port number is 8061, but multiple instances can be run on the same machine by configuring each instance to listen on a different port.

D4Runner /H:localhost /P:8061 "select Employee"

Alternatively, an alias name can be specified if the machine is configured with aliases. The ServerAliases.config files in the machine and user data directories contain the known aliases for the machine. These aliases can be used to connect to an existing instance.

D4Runner /A:Dataphor "select Employee"

If you do not have a ServerAliases.config file, you can build one manually (it is a BOP serialization of an AliasConfiguration container):

<aliasconfiguration 
	xmlns:bop="www.alphora.com/schemas/bop" 
	defaultaliasname="Remote
	xmlns="Alphora.Dataphor.Frontend.Client,Alphora.Dataphor.Frontend.Client"
>
	<connectionalias 
		sessioninfo.unstructureddata="" 
		sessioninfo.hostname="" 
		sessioninfo.catalogcachename="" 
		name="Remote" 
	/>
</aliasconfiguration>

Edit

Running a Dataphor Server In-Process

If an In-Process alias is used, D4Runner will build an in-process instance and use it to process the script. If you do not have an In-Process alias, you can build one using the Alias Editor that launches as part of Dataphoria or the Windows Client, or you can build one manually by editing the ServerAliases.config file:

<aliasconfiguration 
	xmlns:bop="www.alphora.com/schemas/bop" 
	defaultaliasname="In Process" 
	xmlns="Alphora.Dataphor.Frontend.Client,Alphora.Dataphor.Frontend.Client"
>
	<inprocessalias 
		librarydirectory="C:\Users\User\Documents\Src\Alphora\Dataphor\Libraries" 
		sessioninfo.unstructureddata="" 
		sessioninfo.hostname="" 
		sessioninfo.catalogcachename="" 
		name="In Process" 
	/>
	<connectionalias 
		sessioninfo.unstructureddata="" 
		sessioninfo.hostname="" 
		sessioninfo.catalogcachename="" 
		name="Remote" 
	/>
</aliasconfiguration>

Be sure to specify a valid LibraryDirectory for the In-Process instance. You can also specify the CatalogDirectory, as well as any of the options in the SessionInfo structure.

ScrewTurn Wiki version 2.0.36. Some of the icons created by FamFamFam.