All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Removed unnecessary append of possibly large binaries for floats
- Add set_cursor_close_on_commit connection parameter
- Support per connection execution_mode settings
- Support Table.Reader protocol
- Add support for image parameter and column type
- Fix error on redirect request from the server #140 (Thanks @zerobatu)
- Add
:ssl
toextra_applications
- Fix message handling for TCP / SSL errors
- Don't redact password before login handshake is done
- No changes since v2.3.0-rc.1
- Add
:crypto
toextra_applications
- Fix missing
UCS.from_string
for list inputs
- Add initial support for SSL / TLS connections
- Update
tds_encoding
to work with Erlang/OTP >= 24
- Add support for
decimal
2.0 (minimal version is now 1.9)
- Values in
datetimeoffset(n)
columns were failing to decode on match error due to offset unit mismatch (seconds != minutes). - Values in
datetimeoffset(n)
columns of non-UTC timezones were not encoded/decoded correctly.
- Resolves PR #115. Thank you, Chris Martin
- Fix double incrementing of the packet number PR #117. Thank you, DJ Jani
- As per discussion here exposed
Tds.query_multi/4
that should return complete resultset rather than single%Tds.Result{}
so one can run multiple batches in single statement
- ColMetadata token that contains XML schema_info now is parsed correctly.
- Improved compatibility with
ecto_sql
TDS adapter - Removed
Tds.Types.VarChar
. From nowecto_sql
implementsTds.Ecto.VarChar
that should be used in fields if schema requires it. Tds.Type.UUID
is moved toecto_sql
please useTds.Ecto.UUID
instead if you are using ecto.Tds.generate_uuid/0
is added so users can generate valid binary MS UUIDS, there is alsoTds.decode_uuid/1
that should help parsing MS UUID binary to its string representationsp_execute
is now using PROCID in protocol so message size is reduced for few bytes- In explicit transactions (
Tds.transaction/2
) now you can tell transaction manager what isolation level you need. You are encouraged to use this instead ofSET TRANSACTION ISOLATION LEVEL ...
due:- Less round trips to database (saving 3 RPC calls)
- Less bytes are sent over wire since all is in single transaction manager call
- snapshot isolation level works in combination with connection settings
set_allow_snapshot_isolation: :on
- Elixir calendar types are supported if connection is configured with
use_elixir_calendar_types: true
, columns that are of SQL typesSmallDateTime
,DateTime
,DateTime2
,DateTimeOffset
,Time
andDate
will be decoded into elixirNaiveDateTime
,DateTime
,Time
andDate
. If this flag is not set to connection tuples will be used. - Rustler dependency is not mandatory anymore. Requirements are moved to
tds_encoding
library. If you need non latin1 encoding for your varchars please add this library to your dependency and add in configurationconfig :tds, :text_encoder, Tds.Encoding
In order to improve compatibility with ecto_sql
, following breaking changes are introduced in this release:
- Since
tds_ecto
package is deprecated and adapter is moving toecto_sql
, useTds.Types.UUID
for column typesbinary_id
(uuid
). - For same reason as above
Tds.VarChar
is nowTds.Types.VarChar
- If you are using collation other than Latin1 please add dependency to
:tds_encoding
package and following instructions in readme on how to configure tds to use this encoder.
- Implements DBConnection v2.0 to support
ecto_sql
. Please note that starting from this version tds_ecto is not improved anymore and will not use tds version 2.0.0+, instead use ecto_sql where tds_ecto will become part of it starting from version 3.1.0.
char
,nchar
,text
,ntext
,varchar
andnvarchar
encoding improvements for most of the SQL collations. More will be supported.
- Fix for "Error with set_transaction_isolation_level: :read_uncommited" issue #72
- Allow users to choose between
:prepare_execute
and:executesql
style (PR #71) default is:prepare_execute
- Fix unnecessary append of possibly large binaries #70
- Unexpected Environment Change message kills the connection #72
- Adding
sp_unprepare
after SQL statement is executed.
- Improving traceability. Adding hostname and application/program name to login7 tds package so one could easier trace rpc calls in SQL Server. Program name is equal to FQ erlang node name, while hostname is what ever :inet.gethostname() returns. May fail to connect if
:inet
is unable to read hostname.
- Float loses precision. Fix will force floats to be encoded as 64bit floats and param type as float(53) in order to keep all bits
- Fix for: Rollback is called twice on failure in explicit transaction. (DBConnection [mode: :savepoint] support)
UUID/UNIQUEIDENTIFER column is now stored AS IS in database, meaning that compatibility with Ecto.UUID is broken,
if you are using tds_ecto
please use Tds.UUID to encode/decode value to its sting representation. MSSQL has its way of
parsing binary UUID value into string representation as following string illustration:
Ecto.UUID string representation:
f72f71ce-ee18-4db3-74d9-f5662a7691b8
MSSQL string representation:
ce712ff7-18ee-b34d-74d9-f5662a7691b8
To allow other platforms to interpret correctly uuids we had to introduce
Tds.UUID
in tds_ecto
library and Tds.Types.UUID
in tds
both are trying to
keep binary storage in valid byte order so each platform can correctly decode it into string.
So far unique identifiers were and will be returned in resultset as binary, if you need to convert it into
formatted string, use Tds.Types.UUID.parse(<<_::128>>=uuid)
to get that string.
It is safe to call this function several times since it will not fail if value is valid uuid string,
it will just return same value. But if value do not match <<_::128>>
or
<<a::32, ?-, b::16, ?-, c::16, ?- d::16, ?-, e::48>>
it will throw runtime error.
If you are using tds_ecto
:uuid, :binary_id, and Tds.UUID are types you want to use in your models.
For any of those 3 types auto encode/decode will be performed.
Since there was a bug where in some cases old version of tds_ecto
library
could not determine if binary is of uuid type, it interpreted such values as raw binary which caused some issues when non elixir apps interpreted that binary in wrong string format. This was ok as long as parsed string values were not shared between elixir and other platforms trough e.g. JSON messages, but if they did, this could be a problem where other app is not capable to find object which miss parsed uuid value.
- Fixing missing case when string/varchar length is between 2_000 and 4_000 characters long.
- Fix for SET TRANSACTION_ISOLATION_LEVEL issue
- exposing connection options such as:
- set_language - check stored procedure
sp_helplanguage
name column value should be used here - set_datefirst - number in range
1..7
- set_dateformat - atom
:mdy | :dmy | :ymd | :ydm | :myd | :dym
- set_deadlock_priority - one of
:low | :high | :normal | -10..10
- set_lock_timeout - number in milliseconds > 0
- set_remote_proc_transactions - atom :on | :off
- set_implicit_transactions - atom :on | :off
- set_transaction_isolation_level - atom :read_uncommited | :read_commited | :repeatable_read | :snapshot | :serializable
- set_allow_snapshot_isolation - atom :on | :off
- set_language - check stored procedure
- Handle Azure redirecting to new host after env_change token on login #61
- Parameters
:string
,:varchar
and:binary
are encoded asnvarchar(max)
,varchar(max)
andvarbinary(max)
when string or binary length is greater than 2000, otherwisenvarchar(2000)
,varchar(2000)
andvarbinary(2000)
. This change is added to avoid aggressive execution plan caching on SQL Server since parameters may often vary in length, so SQL server will makes execution plan for each parameter length case.
- issue #62 fixing info message token parsing
- issue #59 fixing login error when database name contains special characters like "-"
- fixing issue with done in proc token when stored pcedure is executed
- fixing negative integer/bigint encoding
- Removing obsolete reply function which causing error when connection can not be established to server
- Fixing handle 0 error
- Ping timout caused process to crash
- Double precision floats fix
- StaleEntity error fix when row is inserted into table and done token is incorrectly parsed
- fixing resultset order
- When insert is performed with output incorrect row count is calculated. Causing tds_ecto and ecto to think it is StaleEntity
- Cleaned up code style for Elixir 1.2.0 warnings
- Loosen Elixir dependency
- If server outputs warning result rows are missing.
- Added token decoder for return status of RPC
- Backwards Incompatible Changes
- Rows now return as list instead of tuple
- Backwards Incompatible Changes
- datetime tuples are now {{year,month,day},{hour,min,sec,usec}}
- Added parameter encoding support for datetime2
- Removed dependency on Timex
- Fixed issue where tail would time out queries randomly
- Added ability to pass socket options to connect.
- Set internal socket buffer.
- Fixed issue where messages spanning multiple packets might not finish
- Enum error when calling ATTN on server
- Added support for DateTimeOffset
- Updated Deps
- Added Long Length decoder support for text, ntext and image
- Fixed PLP decode / Encode for sending and receiving large test
- Fixed issue where selecting from NTEXT, TEXT, NVARCHAR(MAX), VARCHAR(MAX) would trunc to 4kb
- Fixed udp port scope for instances
- Fixed: Packets sent to the server which exceed the negotiated packet size would cause the connection to close
- Added support for decoding Time(n) and DateTime2
- Added support for SQL Named Instances, pass instance: "instance_name" in connection options
- Added SET defaults upon connection of: SET ANSI_NULLS ON; SET QUOTED_IDENTIFIER ON; SET CURSOR_CLOSE_ON_COMMIT OFF; SET ANSI_NULL_DFLT_ON ON; SET IMPLICIT_TRANSACTIONS OFF; SET ANSI_PADDING ON; SET ANSI_WARNINGS ON; SET CONCAT_NULL_YIELDS_NULL ON;
- Fixed issue with empty strings and binaries being converted to nil
-
datetime2 with 0 usec's will be transmitted as datetime
-
Backwards incompatable changes
- Changed datetime to be passed back as {{year, month, day} ,{hour, min, sec, microsec}}
- Changed default connection timeout to 5000 from :infinity
- Added caller pid monitoring to cancel query if caller dies
- Call ATTN if the caller who dies is the currently executing query
- Added API for ATTN call
<<<<<<< HEAD
=======
1007dc1 (Misc doc changes)
- Fixed issue where driver would not call Connection.next when setting the state to :ready
- Fixed UCS2 Encoding
- Fixed encoding for integers
- Removed Timer from queued commands.
- Changed error handling to error func
- Adding missing date time decoders
- Compatibility updates for ecto
- Fixed issue with Bitn always returning true
- Fixed missing data return for char data decoding
- Added float encoders
- Cleaned up logger functions
- First Release