Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

User Facing NameTypeDescriptionConstraints
LabelStringLabel for UI
HostStringMSSQL host (serverName)Required (defaults to localhost on UI)
PortNumberThe port where SQL Server is listening. If the port number is specified in the connection string, no request to SQLbrowser is made. When the port and instanceName are both specified, the connection is made to the specified port. However, the instanceName is validated and an error is thrown if it does not match the port.

Important: We recommend that the port number is always specified, as this is more secure than using SQLbrowser

Optional

(default 1433)
DatabaseStringDatabase name to connectRequired
Authentication Type SelectIndicates which SQL authentication method will be used for the connection. Use 'SQL Login' to connect to a SQL Server using username and password properties. 'Active Directory Password' can be used to connect to an Azure SQL Database/Data Warehouse using an Azure AD principal name and password
Username

String

DB usernameRequired
PasswordStringUser passwordRequired
Connection ArgumentsKeyvalue

A list of arbitrary string tag/value pairs as connection arguments, list of propertiesĀ 

https://docs.microsoft.com/en-us/sql/connect/jdbc/setting-the-connection-properties?view=sql-server-2017


Database CommandStringDatabase command to runValid SQL query
Instance NameStringThe SQL Server instance name to connect to. When it is not specified, a connection is made to the default instance. For the case where both the instanceName and port are specified, see the notes for port.

If you specify a Virtual Network Name in the Server connection property, you cannot use instanceName connection property
Optional
Query TimeoutNumberThe number of seconds to wait before a timeout has occurred on a query. The default value is -1, which means infinite timeout. Setting this to 0 also implies to wait indefinitely.Optional
Application IntentSelectDeclares the application workload type when connecting to a server.

Possible values: 'ReadWrite' and 'ReadOnly'.

Default: 'ReadWrite'.

Connect TimeoutNumberTime in seconds to wait for a connection to the server before terminating the attempt and generating an error.Optional
Column Encryption Select

Default column encryption setting for all the commands on the connection. When enabled the JDBC driver will transparently encrypt and decrypt sensitive data stored in encrypted database columns in the SQL Server.

Possible values are: 'Enabled' and 'Disabled'.

Default: 'Disabled'.

EncryptSelect

When set to 'Yes', SQL Server uses SSL encryption for all data sent between the client and server if the server has a certificate installed.

Possible values are: 'Yes' and 'No'.

Default: 'No'.

Trust Server Certificate Select

When set to 'Yes' (and encryption enabled), SQL Server uses SSL encryption for all data sent between the client and server without validating the server certificate.

Possible values are: 'Yes' and 'No'.

Default: 'No'.

Workstation ID StringUsed to identify the specific workstation in various SQL Server profiling and logging tools. Optional
Failover Partner StringThe name or network address of the instance of SQL Server that acts as failover partner. Optional
Packet Size NumberThe network packet size used to communicate with SQL Server, specified in bytes. It's not recommended to specify packet size property when the encryption is enabled. Otherwise, the driver might raise a connection error. Optional
Current Language StringMust correspond to the SQL Server language record name and specifies the language environment for the session. The session language determines the datetime formats and system messages. Optional


Data Types Mapping

MS SQL Data TypeCDAP Schema Data TypeSupportComment
BIGINTSchema.Type.LONG+
BINARYSchema.Type.BYTES+
BITSchema.Type.BOOLEAN+
CHARSchema.Type.STRING+
DATESchema.LogicalType.DATE+
DATETIMESchema.LogicalType.TIMESTAMP_MICROS+
DATETIME2Schema.LogicalType.TIMESTAMP_MICROS+
DATETIMEOFFSETSchema.Type.STRING*
DECIMALSchema.LogicalType.DECIMAL+
FLOATSchema.Type.FLOAT+
IMAGESchema.Type.BYTES+
INTSchema.Type.INT+
MONEYSchema.LogicalType.DECIMAL+
NCHARSchema.Type.STRING+
NTEXTSchema.Type.STRING+
NUMERICSchema.LogicalType.DECIMAL+
NVARCHARSchema.Type.STRING+
NVARCHAR(MAX)Schema.Type.STRING+
REALSchema.Type.FLOAT+
SMALLDATETIMESchema.LogicalType.TIMESTAMP_MICROS+
SMALLINTSchema.Type.INT+
SMALLMONEYSchema.LogicalType.DECIMAL+
TEXTSchema.Type.STRING+
TIMESchema.LogicalType.TIME_MICROS+
TIMESTAMPSchema.Type.BYTES*TIMESTAMP is the synonym for the ROWVERSION data type, values of which are automatically generated. Thus TIMESTAMP can not be supported by Sink plugin.
TINYINTSchema.Type.INT+
UDTSchema.Type.BYTES+
UNIQUEIDENTIFIERSchema.Type.STRING+
VARBINARYSchema.Type.BYTES+
VARBINARY(MAX)Schema.Type.BYTES+
VARCHARSchema.Type.STRING+
VARCHAR(MAX)Schema.Type.STRING+
XMLSchema.Type.STRING+
SQLVARIANTSchema.Type.STRING*
GEOMETRYSchema.Type.BYTES+
GEOGRAPHYSchema.Type.BYTES+


Approach

Create a module mssql-plugin inĀ database-plugins project, reuse existing database-plugins code if possible. Add MSSQL-specific properties to configuration, add support for MSSQL-specific datatypes. Update UI widgets JSON definitions.

...