SQLProvider

DacpacParser Module

Module for parsing SQL Server Data Tools (SSDT) .dacpac files to extract database schema information. Provides functionality to read and parse the model.xml file contained within .dacpac packages.

Types and nested modules

Type/Module Description

RegexParsers

CommentAnnotation

Represents a comment annotation for schema documentation.

ConstraintColumn

Represents a column in a constraint definition.

PrimaryKeyConstraint

RefTable

Represents a table reference in relationship definitions.

SsdtColumn

Represents a database table column from SSDT schema.

SsdtDescriptionItem

SsdtRelationship

Represents a foreign key relationship between tables.

SsdtSchema

SsdtStoredProc

SsdtStoredProcParam

SsdtTable

SsdtView

Represents a database view from SSDT schema.

SsdtViewColumn

Represents a view column from SSDT schema.

UDDTInheritedType

UDDTName

Functions and values

Function or value Description

att nm node

Full Usage: att nm node

Parameters:
Returns: string

Extracts an XML attribute value from a node, returning an empty string if the attribute doesn't exist. This is a convenience function for cases where a default empty value is acceptable. param nm: The attribute name to extract param node: The XML node to extract from returns: The attribute value, or empty string if not found

nm : string
node : XmlNode
Returns: string

attMaybe nm node

Full Usage: attMaybe nm node

Parameters:
Returns: string option

Safely extracts an XML attribute value from a node, returning None if the attribute doesn't exist. param nm: The attribute name to extract param node: The XML node to extract from returns: Some(attribute value) if found, None otherwise

nm : string
node : XmlNode
Returns: string option

extractModelXml dacPacPath

Full Usage: extractModelXml dacPacPath

Parameters:
    dacPacPath : string

Returns: string

Extracts the model.xml file from a SQL Server Data Tools (SSDT) .dacpac package. The model.xml contains the complete database schema definition. param dacPacPath: Path to the .dacpac file returns: The XML content of the model.xml file as a string

dacPacPath : string
Returns: string

parseXml xml

Full Usage: parseXml xml

Parameters:
    xml : string

Returns: SsdtSchema

Parses the model.xml content extracted from a SQL Server Data Tools (SSDT) .dacpac file. Extracts database schema information including tables, views, columns, relationships, and stored procedures. param xml: The XML content from the model.xml file returns: A parsed representation of the database schema

xml : string
Returns: SsdtSchema

toXmlNamespaceDoc ns xml

Full Usage: toXmlNamespaceDoc ns xml

Parameters:
    ns : string
    xml : string

Returns: XmlDocument * (string -> 'a -> XmlNode) * (string -> 'b -> XmlNode seq)

Creates an XML document with namespace support and returns helper functions for node selection. This is specifically designed for parsing SSDT model.xml files with their Microsoft namespace. param ns: The XML namespace URI param xml: The XML content to parse returns: A tuple containing (XmlDocument, single node selector function, multiple nodes selector function)

ns : string
xml : string
Returns: XmlDocument * (string -> 'a -> XmlNode) * (string -> 'b -> XmlNode seq)

Type something to start searching.