@@ -411,6 +411,16 @@ var q = db.From<Person>()
411411db .UpdateOnly (new Person { FirstName = " JJ" , LastName = " Hendo" }, onlyFields : q );
412412```
413413
414+ Using an Object Dictionary:
415+
416+ ``` csharp
417+ var updateFields = new Dictionary <string ,object > {
418+ [nameof (Person .FirstName )] = " JJ" ,
419+ };
420+
421+ db .UpdateOnly <Person >(updateFields , p => p .LastName == " Hendrix" );
422+ ```
423+
414424Using a typed SQL Expression:
415425
416426``` csharp
@@ -2107,22 +2117,32 @@ public class PocoTable
21072117
21082118 [CustomField (" DECIMAL(18,4)" )]
21092119 public decimal ? DecimalColumn { get ; set ; }
2120+
2121+ [CustomField (OrmLiteVariables .MaxText )] // = {MAX_TEXT}
2122+ public string MaxText { get ; set ; }
2123+
2124+ [CustomField (OrmLiteVariables .MaxTextUnicode )] // = {NMAX_TEXT}
2125+ public string MaxUnicodeText { get ; set ; }
21102126}
21112127
21122128db .CreateTable <PocoTable >();
21132129```
21142130
2115- Generates and executes the following SQL:
2131+ Generates and executes the following SQL in SQL Server :
21162132
21172133``` sql
21182134CREATE TABLE "PocoTable "
21192135(
21202136 " Id" INTEGER PRIMARY KEY ,
21212137 " CharColumn" CHAR (20 ) NULL ,
2122- " DecimalColumn" DECIMAL (18 ,4 ) NULL
2123- );
2138+ " DecimalColumn" DECIMAL (18 ,4 ) NULL ,
2139+ " MaxText" VARCHAR (MAX) NULL ,
2140+ " MaxUnicodeText" NVARCHAR(MAX) NULL
2141+ );
21242142```
21252143
2144+ > OrmLite replaces any variable placeholders with the value in each RDBMS DialectProvider's ` Variables ` Dictionary.
2145+
21262146#### Pre / Post Custom SQL Hooks when Creating and Dropping tables
21272147
21282148Pre / Post Custom SQL Hooks allow you to inject custom SQL before and after tables are created or dropped, e.g:
@@ -2877,6 +2897,30 @@ public class Table
28772897}
28782898```
28792899
2900+ ### Bitwise operators
2901+
2902+ The Typed SqlExpression bitwise operations support depends on the RDBMS used.
2903+
2904+ E.g. all RDBMS's support Bitwise ` And ` and ` Or ` operators:
2905+
2906+ ``` csharp
2907+ db .Select <Table >(x => (x .Id | 2 ) == 3 );
2908+ db .Select <Table >(x => (x .Id & 2 ) == 2 );
2909+ ```
2910+
2911+ All RDBMS Except for SQL Server support bit shift operators:
2912+
2913+ ``` csharp
2914+ db .Select <Table >(x => (x .Id << 1 ) == 4 );
2915+ db .Select <Table >(x => (x .Id >> 1 ) == 1 );
2916+ ```
2917+
2918+ Whilst only SQL Server and MySQL Support Exclusive Or:
2919+
2920+ ``` csharp
2921+ db .Select <Table >(x => (x .Id ^ 2 ) == 3 );
2922+ ```
2923+
28802924## SQL Server Features
28812925
28822926### Memory Optimized Tables
0 commit comments