SqlQuerySpec interface

Represents a SQL query in the Azure Cosmos DB service.

Queries with inputs should be parameterized to protect against SQL injection.

Example

Parameterized SQL Query

const query: SqlQuerySpec = {
  query: "SELECT * FROM Families f where f.lastName = @lastName",
  parameters: [
    {name: "@lastName", value: "Wakefield"}
  ]
};

Properties

parameters

The parameters you provide in the query

query

The text of the SQL query

Property Details

parameters

The parameters you provide in the query

parameters?: SqlParameter[]

Property Value

query

The text of the SQL query

query: string

Property Value

string