Field Squared API Services

<back to all web services

IntegrationDataTableDDL

Generates the database DDL for a given integration data table. Database types supported: SQLServer

The following routes are available for this service:
POST/{Workspace}/IntegrationDataTableDDL
import Foundation
import ServiceStack

/**
* Generates the database DDL for a given integration data table.  Database types supported: SQLServer
*/
public class IntegrationDataTableDDL : Codable
{
    public var workspace:String
    public var databaseType:String
    public var dataTable:IntegrationDataTable
    public var ddl:String

    required public init(){}
}

public class IntegrationDataTable : Codable
{
    public var name:String
    public var columns:[MetadataItem] = []
    public var rows:[[String]] = []

    required public init(){}
}

public class MetadataItem : Codable
{
    public var name:String
    public var datatype:String
    public var length:String
    public var label:String

    required public init(){}
}


Swift IntegrationDataTableDDL DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /{Workspace}/IntegrationDataTableDDL HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Workspace: String,
	DatabaseType: String,
	DataTable: 
	{
		Name: String,
		Columns: 
		[
			{
				Name: String,
				Datatype: String,
				Length: String
			}
		],
		Rows: 
		[
			[
				String
			]
		]
	},
	DDL: String
}