Packages
tds
1.1.0
2.3.8
2.3.7
2.3.6
2.3.5
2.3.4
2.3.2
2.3.1
2.3.0
2.3.0-rc.1
2.3.0-rc.0
2.2.0
2.1.3
2.1.2
2.1.1
2.1.0
2.0.4
2.0.3
2.0.2
2.0.1
2.0.1-rc2
2.0.1-rc1
2.0.0
retired
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.1.7
1.1.6
1.1.5
1.1.4
1.1.3
1.1.2
1.1.0
1.0.19
1.0.18
1.0.17
1.0.16
1.0.15
1.0.14
1.0.13
1.0.12
1.0.11
1.0.10
1.0.9
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
0.5.4
0.5.3
0.5.2
0.5.1
0.5.0
0.4.0
0.3.0
0.2.8
0.2.7
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
Microsoft SQL Server client (Elixir implementation of the MS TDS protocol)
Current section
Files
Jump to
Current section
Files
lib/tds/date_time.ex
defmodule Tds.Date do
@moduledoc """
Struct for MSSQL date.
https://msdn.microsoft.com/en-us/library/bb630352.aspx
## Fields
* `year`
* `month`
* `day`
"""
@type t :: %__MODULE__{year: 1..9999, month: 1..12, day: 1..31}
defstruct year: 1900,
month: 1,
day: 1
end
defmodule Tds.Time do
@moduledoc """
Struct for MSSQL time.
https://msdn.microsoft.com/en-us/library/bb677243.aspx
## Fields
* `hour`
* `min`
* `sec`
* `fsec`
"""
@type t :: %__MODULE__{
hour: 0..23,
min: 0..59,
sec: 0..59,
fsec: 0..9_999_999
}
defstruct hour: 0,
min: 0,
sec: 0,
fsec: 0
end
defmodule Tds.DateTime do
@moduledoc """
Struct for MSSQL DateTime.
https://msdn.microsoft.com/en-us/library/ms187819.aspx
## Fields
* `year`
* `month`
* `day`
* `hour`
* `min`
* `sec`
"""
@type t :: %__MODULE__{
year: 1753..9999,
month: 1..12,
day: 1..31,
hour: 0..23,
min: 0..59,
sec: 0..59,
fsec: 0..999
}
defstruct year: 1900,
month: 1,
day: 1,
hour: 0,
min: 0,
sec: 0,
fsec: 0
end
defmodule Tds.DateTime2 do
@moduledoc """
Struct for MSSQL DateTime2.
https://msdn.microsoft.com/en-us/library/bb677335.aspx
## Fields
* `year`
* `month`
* `day`
* `hour`
* `min`
* `sec`
* `usec`
"""
@type t :: %__MODULE__{
year: 1..9999,
month: 1..12,
day: 1..31,
hour: 0..23,
min: 0..59,
sec: 0..59,
fsec: 0..9_999_999
}
defstruct year: 1900,
month: 1,
day: 1,
hour: 0,
min: 0,
sec: 0,
# fractional secs
fsec: 0
end
defmodule Tds.DateTimeOffset do
@moduledoc """
Struct for MSSQL DateTimeOffset.
https://msdn.microsoft.com/en-us/library/bb630289.aspx
## Fields
* `year`
* `month`
* `day`
* `hour`
* `min`
* `sec`
* `usec`
"""
@type t :: %__MODULE__{
year: 1..9999,
month: 1..12,
day: 1..31,
hour: 0..23,
min: 0..59,
sec: 0..59,
fsec: 0..9_999_999,
offset_hour: -14..14,
offset_min: 0..59
}
defstruct year: 1900,
month: 1,
day: 1,
hour: 0,
min: 0,
sec: 0,
# fractional secs
fsec: 0,
offset_hour: 0,
offset_min: 0
end
defmodule Tds.SmallDateTime do
@moduledoc """
Struct for MSSQL SmallDateTime.
https://msdn.microsoft.com/en-us/library/ms182418.aspx
## Fields
* `year`
* `month`
* `day`
* `hour`
* `min`
* `sec`
"""
@type t :: %__MODULE__{
year: 1900..2079,
month: 1..12,
day: 1..12,
hour: 0..23,
min: 0..59,
sec: 0..59
}
defstruct year: 1900,
month: 1,
day: 1,
hour: 0,
min: 0,
sec: 0
end