Versions Compared

Key

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

...

  • Properties take their type from the definition in the metadata (e.g. property Active is a Boolean)

  • Functions define the result type (e.g. function CreateGuid() returns a GUID)

Marshalling types

Some conversions are straightforward and unlikely to cause issues in either SQL or the local evaluator:

...

  • If a String is expected, a DateTime will be converted first (to something like "2021-04-20 12:00:00").

  • If an Int is expected, a String like "Hello" cannot be converted and causes an error.

Operator parameters

While many of the operators support various types of arguments, most of them will marshall all parameters to a common type.

...

  • The SQL Mapper makes no attempt to marshal the values to the same type. The database is the final arbiter on how it handles an operation that involves unequal types, including throwing an error.

  • The local evaluator makes a best effort to marshall types for comparison. E.g.

  • Use the cast operator to explicitly marshal values to known types to avoid errors.

Primitive types

The primitive types are relatively standard.

Type

Example

Notes

Whole Numbers

6

C# int

Real numbers

45.678 or 45.678f

C# double

Money

45.678m

C# decimal

Constant null

null

C# null

Boolean constants

truefalse

c# true and false

Single-quoted strings

'A ''quoted'' string'

Pascal-style escaping

Double-quoted strings

"A \"quoted\" string"

C-style escaping

Lists

[A, B, 2, "three"]

Item can be any type

Dates, times, and timespans

A product can work with Datetimes and Times and Timespans in the following ways:

...

  • DateTime + TimeSpan = DateTime

  • DateTime - TimeSpan = DateTime

  • DateTime - DateTime = TimeSpan

  • TimeSpan + TimeSpan = TimeSpan

  • TimeSpan - TimeSpan = TimeSpan

Guids

A product can work with Guids in the following ways:

...