Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 91d15e3

Browse files
committed
Updated README with features in latest release.
1 parent bfdad43 commit 91d15e3

File tree

1 file changed

+53
-1
lines changed

1 file changed

+53
-1
lines changed

README.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,63 @@ extracting them from the published NuGet packages. The url to download a nuget p
5050

5151
So to get the OrmLite MySQL provider in OSX/Linux (or using gnu tools for Windows) you can just do:
5252

53-
wget -O OrmLite.MySql.zip http://packages.nuget.org/api/v1/package/ServiceStack.OrmLite.MySql/3.9.28
53+
wget -O OrmLite.MySql.zip http://packages.nuget.org/api/v1/package/ServiceStack.OrmLite.MySql/3.9.37
5454
unzip OrmLite.MySql.zip 'lib/*'
5555

5656
which will download and extract the dlls into your local local `lib/` folder.
5757

58+
## IMPORTANT NOTICE
59+
60+
Please upgrade your client code to use non-deprecated methods as we will be removing access to deprecated APIs in the next release of OrmLite.
61+
62+
***
63+
64+
## T4 Template Support
65+
66+
[Guru Kathiresan](https://github.com/gkathire) continues to enhance [OrmLite's T4 Template support](https://github.com/ServiceStack/ServiceStack.OrmLite/tree/master/src/T4) which are useful when you want to automatically generate POCO's and strong-typed wrappers for executing stored procedures.
67+
68+
69+
## New Parameterized API's
70+
71+
We've now added API's that use parameterized statements for all SQL operations, these are identified with a **Param** suffix, e.g:
72+
73+
### Parameterized Write operations
74+
75+
```csharp
76+
db.InsertParam(new Person { Id = 1, FirstName = "Jimi", LastName = "Hendrix", Age = 27})
77+
db.UpdateParam(new Person { Id = 1, FirstName = "Jimi", LastName = "Hendrix", Age = 27})
78+
db.DeleteByIdParam<Person>(1)
79+
```
80+
81+
### Parameterized Read operations
82+
83+
```csharp
84+
var people = db.SelectParam<Person>(q => q.Age == 27)
85+
var person = db.GetByIdParam<Person>(1)
86+
87+
//Existing parameterized query API's
88+
var people = db.Where<Person>(new { FirstName = "Jimi", Age = 27 })
89+
var people = db.Query<Track>("FirstName = @name and Age = @age", new { name = "Jimi", age = 27 })
90+
```
91+
92+
Apart from a slight performance increase, parameterized API's now lets you insert and update binary blob data. At the same time as these new parameterized API's, we've also added support for querying binary blob data.
93+
94+
## New API's to execute custom SQL
95+
96+
Prior to v3.9.37 the ways to execute custom SQL was with `db.ExecuteSql()` which as it only returned an int code, users were using `db.Query` to read arbitrary sql returning tabular resultsets. However db.Query is only intended for SELECT statements. For this purpose we've introduced new API's for executing custom sql, e.g:
97+
98+
```csharp
99+
List<Poco> results = db.SqlList<Poco>("EXEC GetAnalyticsForWeek 1");
100+
List<Poco> results = db.SqlList<Poco>("EXEC GetAnalyticsForWeek @weekNo", new { weekNo = 1 });
101+
102+
List<int> results = db.SqlList<int>("EXEC GetTotalsForWeek 1");
103+
List<int> results = db.SqlList<int>("EXEC GetTotalsForWeek @weekNo", new { weekNo = 1 });
104+
105+
int result = db.SqlScalar<int>("EXEC SELECT 10");
106+
```
107+
108+
Some more examples can be found in [SqlServerProviderTests](https://github.com/ServiceStack/ServiceStack.OrmLite/blob/master/tests/ServiceStack.OrmLite.Tests/SqlServerProviderTests.cs).
109+
58110
## New Simplified API
59111
We've streamlined our API, now all OrmLite extensions that used to be on `IDbCommand` now hang off `IDbConnection`
60112
(just like Dapper), this reduces the boiler-plate when opening a connection to a single line, so now you can

0 commit comments

Comments
 (0)