-
Notifications
You must be signed in to change notification settings - Fork 25
Release notes
Semantic versioning is used. See http://semver.org for more info. Basically this means that version format is: v[Major].[Minor].[Patch] and as long as Major hasn't been bumped, you should be able to update without any breaking API changes. But, please! Do take a backup of your database before testing a new version.
Easy! Take a backup of your production DB. Then setup a clean database with the new SisoDb version and upsert all the entities you need in the new database. E.g by using Db.UpsertStructureSet<Customer>();
and then do a schema compare and generate a change script.
No db-changes to schemas etc.
- [Fix]: Fixed bug with
SqlCe4Connection
usingAppData
for storage. - [Fix]: Updated to latest Glimpse version
- [Fix]: Updated to latest Miniprofiler version
- [Fix]: Updated to latest ServiceStack version
No db-changes to schemas etc.
-
New: Added
GetIds
that is located on session:Session.GetIds(i => i.Value.QxIn(1,2,3,4));
. Use it to retrieve/lookup StructureIds more efficiently since the structure doesn't need to be deserialized. - [Fix]: The Cache-container now gets an unique name
- [Fix]: When working with polygons in SisoDb.Spatial, they are now validated before saved.
ONE small db-change exists. Change script that generates SQL can be found here.
-
New:
Db.Pipe
can be assigned an implementation ifIDbPipe
which hasReading | Writing
members that will be called as close to the Db as possible. This can be used to hook in compression and encryption of JSON etc. -
New:
SisoDb.Azure
has been added as an provider. It does not allow DB operations likeCreateDatabase, DropDatabase
etc. You will need to deploy an initialized db the first time. Tables etc will be created on the fly. We are working on letting you activate premade NuGets with compression to save bandwith and storage, but for now you could do that with the DbPipe above. -
New:
Skip(x)
has been added to assist the upcoming LINQ-provider -
New:
Session.Events.OnCommitted : Action<ISisoDatabase, Guid>
- which could be used to take actions on queued actions as a result of hooking into e.gSession.Events.OnInserted
. You could e.g. then add stuff to Lucene, publish on a servicebus or whatever. Read more -
New:
Session.Events.OnRolledback : Action<ISisoDatabase, Guid>
- [Tweak]: Index and SQL for query generation
- [Tweak]:
First, FirstOrDefault,..., Single, SingleOrDefault,...
is now much more performant. - [Fix]: When adding polygon using SisoDb.Spatial, and you added the polygon in wrong order, it will get inverted and therefore can not be used for checking if points is contained in it.
- [Fix]: Better exception details when using paging etc. without order by.
- [Tweak/Fix]: If you drew the polygons in wrong order they got inverted (SQL Server issue). There is now a fix implemented that will identify this and try to fix it when you insert/update polygons. There's a change script that you can find here. Note! Use at own risk and try on backup first.
ONE small db-change exists. This is the final release of v16.0.0
. Small changes since v16.0.0-pre3
. For a complete change history since v15.1.0
, check changes history of v16.0.0-pre1, pre2 & pre3
, below
Db-change: To get it compliant with SQL Azure, Structure-tables with GUID's as identifiers has dropped the rowguidcol
attribute. You should be able to continue and use your current schema with v16.0.0, but you can also drop it if you want. Change script that generates SQL can be found here
-
New:
db.WithSession(s => {})
- [Changed]:
session.Spatials()
-->session.Spatial()
- [Changed]: Structure-tables with GUIDs as identifiers has removed the
rowguidcol
attribute which makes SisoDb compliant with SQL Azure. - [Fix]:
session.Spatial().ContainsPoint
andsession.Spatial().ContainsPointAfterExpand
.
No db-changes to schemas etc. This is the last pre-release before the final release of v16.0.0. Nothing more is planned.
-
New:
db.UseOnceTo().Query<T>().Where(i => i.Value == 42).Cacheable()
which will, if you have enabled a cacheprovider, cache the result, so if you run the same query again, you will not hit the db. -
New:
db.UseOnceTo().GetByQuery<T>(i => i.Value == 42):T
andsession.GetByQuery<T>(i => i.Value == 42):T
, both first query any present cacheprovider. If no match is found, db is queried and cache is updated. Which is the same behavior asGetById
. -
New: Now exposing
CacheProviderExtensions
available via import ofSisoDb.Caching
inSisoDb.dll
. It could be used to get some help with keeping the cache in a correct state, depending on if cache is enabled or not per type and depending on what state the session has set the cache-consume mode in. This is found insession.CacheConsumeMode
which could be[UpdateCacheWithDbResult, DoNotUpdateCacheWithDbResult]
- [Fixed]: Issue with cache and deletes.
- [Changed]: Members marked as Uniques can not be classified as
Text
. Read more about Texts vs Strings - [Tweak]:
Any()
without any query-expression now first checks against cache instead of hitting the db. - [Removed]:
SisoDb.AspWebCache
is being removed. UseSisoDb.MsMemCache
instead. It works both in web and non web contexts.
No db-changes to schemas etc.
- [Fix]: Issue with
DbClient.AdoDriver.CommandTimeout
forSQLCE4
driver. Shame on me! -
New:
SisoDb.Spatial
which lets you access (currently very few) set of spatial operations viasession.Spatials()
. Pull requests for more features are accepted. -
New: Exposing
session.ExecutionContext
which could be used to write external libs: blog post.
No db-changes to schemas etc. This release is about removing stuff seldom needed and to clean up the code-base so that we can focus on bringing in more useful stuff in the future.
-
New:
db.Configure().PreserveIds()
will use theStructureBuilderPreservingId
which assumes you assign values for theId
. -
New:
db.Configure().UseAutoIds()
will use theStructureBuilderAutoId
which will assign an Id if you have not. -
New:
StructureBuilderAutoId
, assigns anId
if you have not. Is used bydb.Configure().UseAutoIds()
or if you want per schema, you can hook it in usingDatabase.StructureBuilders.ResolveBuilderForInsertsBy = (schema, dbClient) => {...}
-
New: Every operation where you can say for structure type
T
, return asTResult
, should now support anonymous types, as long as the deserializer supports it that is. All provided does. -
New:
StructureBuilders.GuidStructureIdGeneratorFn
can now be swapped per schema. -
New:
StructureBuilders.IdentityStructureIdGeneratorFn
can now be swapped per schema. -
New:
Session.IsAborted
which is a result of a call toSession.Abort
. If this has been done. No further operations will be accepted against theSession
and a rollback will be performed. -
New: New query-operator:
QxNotIn
E.gQuery<X>().Where(x => x.int.QxNotIn(1 ,2, 3)
orQuery<X>().Where(x => x.ints.QxNotIn(1 ,2, 3)
-
New:
Session.CheckoutById
will use exclusive rowlock so that no one else could touch it. Remember, this will not be released until the session is disposed. -
New:
Session.GetByIdAs<TOut>(type, id)
-
New:
Session.GetByIdsAs<TOut>(type, ids)
-
New:
Session.DbClient
is now exposed so that you can access the underlying connection and transaction if you want to do some manual stuff that isn't supported viasession.Advanced
. -
New:
DbClient.AdoDriver.CommandTimeout
is now exposed and could be used to adjust the command timeout. Default has been lowered to 15s. -
New:
IDbClient
has some new hooks:AfterCommit
andAfterRollback
andOnComplete
. -
New: Session hooks:
Session.OnInserted | OnUpdated | OnDeleted | OnDeletedByQuery
. -
New: New NuGet for alternative serializer,
SisoDb.JsonNet
-
New: New NuGet for using ServiceStack serializer as NuGet instead of the contained source version,
SisoDb.ServiceStack
- [Fixed]:
OrderBy
for booleans and guids. - [Fixed]: Storing structure with list of nested structures having a complex type with a string member being null.
- [Changed]: NOTE! Nested structures are now treated as any other nested complex type, hence they are indexed and seen as part of the document. So
Db.Configure().StructureType<Foo>(cfg => cfg.AllowNestedStructures())
has no effect anymore and has been removed. - [Changed]: Members ending with name
Body
is now treated asText
and notString
. Either change this convention viaDb.StructureSchemas.SchemaBuilder.DataTypeConverter.MemberNameIsForTextType
or hook in your own implementation of the converter, or live with the change and move any String members withBody
from the String-tables to the Text-tables. - [Changed]:
Session.Failed
-->Session.HasFailed
. - [Changed]:
PineCone
that long time ago was created as an extract of SisoDb is now once again part of SisoDb. Hence namespaces likePineCone, SisoDb.PineCone
is nowSisoDb
. AlsoPineConeException
is nowSisoDbException
. - [Changed]:
Db.Settings.AllowUpsertsOfSchemas --> Db.Settings.AllowDynamicSchemaCreation
- [Changed]:
Db.Settings.SynchronizeSchemaChanges --> Db.Settings.AllowDynamicSchemaUpdates
- [Changed]:
db.Configure().UseSerializerResolvedBy(...)
-->db.Configure().UseSerializer(x)
- [Changed]:
db.Configure().UseCacheProviderResolvedBy(...)
-->db.Configure().UseCacheProvider(x)
- [Changed]:
db.Configure().UseManualStructureIdAssignment()
-->db.Configure().UseManualIds()
- [Changed]:
session.Advanced.UpdateMany
is now located directly onsession.UpdateMany
- [Changed]:
session.Advanced.DeleteByQuery
is now located directly onsession.DeleteByQuery
- [Changed]:
MultipleActiveResultsets
(MARS) is now being forced when supported. - [Changed]: Low-level change,
ITransactionalDbClient --> IDbClient
- [Changed]: When upserting db-schemas, transactions are now used. This reduces the number of connections needed.
- [Changed]: Parallel deserialization has been removed. If you want it, implement a custom
ISisoDbSerializer
and hook it in usingdb.Configure().UseSerializer(...)
- [Removed]:
ITransactionalSession
Transactions are still used, the members of the interface has been moved toISession
. - [Removed]:
Serializer.Options
If you need to tweek internals. Extend one of the existingDefaultSisoSerializer | JsonNetSisoSerializer | ServiceStackSisoSerializer
and hook it in usingdb.Configure().UserSerializer(x)
- [Removed]: Removed signed build. If you want it, build it your self.
- [Removed]: Includes, in favor of something better. The "better" is not done yet though. Will be a v16.x.x release. Aiming of async multi queries that you can merge together.
- [Removed]: Awful
IConnectionStrings
and related stuff. Hence there´s nosisodb:foo, foo,||plain:bar, bar
connectionstrings anymore. For a long time the prefered connection string has been to not use the one above, but a plain one. E.gdata source=.;initial catalog=foo;.....
This is now the only supported format.
No db-changes to schemas etc.
- [Fixed]: When assigning new
StructureTypeConfiguration collection
todb
, then the serializer couldn't resolve configs. - [Fixed]: Combination of
QxAny & QxIn
caused aNullReferenceException
- [Fixed: Issue when using
Update<InterfaceWithConcurrencyToken>(item);
where item is an interface with a concurrency token. - New: RegenerateQueryIndexesFor now supports interfaces.
-
New: Support for interfaces with update expressions via
Update<TContract, TImpl(id,expression, ...)
-
New:
Collection.QxAny()
- That is QxAny() without an expression, for strings and value-types. - [Tweak]: SQL for
Count
has been made faster. - [Tweak]: SQL for
Any
has been made faster.
No db-changes to schemas etc.
[Fixed]: Fixed issue with models having the combination of exactly one string member and one enum member, which caused one of them to be lost upon insert.
No db-changes to schemas etc. Only one small change in the API that has lead to major bump.
- [Changed]: The syntax for how to manually control what to index has been simplified.
-
New:
Db.Configure().StructureType<Foo>(cfg => cfg.AllowNestedStructures());
Allows nested structures to be stored as well as indexed. Read more - [Fix]: Due to a bug in ServiceStack.Text, dates stored as UTC when using ISO8601, was deserialized as local time. This has been fixed.
- [Fix]: Empty collections of items holding items with members marked as unique, caused an exception.
[Fixed]: Updated to latest ServiceStack.Text to get fix with deserializing 01:10:20
to Nullable<TimeStamp>
.
Note! In this release the assembly dependencies on NCore, Ensure.That and PineCone
has been removed. Instead those packages has been included as source NuGets, inside the SisoDb assembly.
- [Fixed]: Replaced Ensure.That, NCore and PineCone as assembly references and instead incorporated them in SisoDb using their Source distributed NuGets.
- [Fixed]: The
QxIn
operator can now be used with an array variable of values. SoDeleteByQuery
andQuery<T>.Where
can now use it. -
New:
GetById(type, id) : object
-
New:
GetByIds(type, ids) : IEnumerable<object>
-
New: Now providing a second signed build for SisoDb, but this IS NOT distributed via NuGet, but as a download on GitHub. All projects can not be signed due to references not being signed. These are:
SisoDb.Glimpse
.
- [Fix]: Inline string variable support in queries for
ToLower
andToUpper
. E.gi => i.Firstname == firstname.ToLower()
. NOTE! This is not necessary unless you have a collation that is case-sensitive. -
New:
String.QxIsExactly("Foo")
which can be used to force a exact binary compare of strings. Note! This leads to that indices in the Db can not be used efficiently for that member in the query. Hence, use only when needed. If you can, change the collation for that Indexes table instead.
You can now also download a zip with all binaries and pdb's under Downloads.
-
New:
ITransactionalSession
is now implemented in the currently existing providers sessions, hence you can now cast your session to anITransactionalSession
and use its memberMarkAsFailed()
to force a rollback upon dispose.
You can now also download a zip with all binaries and pdb's under Downloads.
This stable release has db-changes. Structures tables now has a clustrered index and some more custom user defined table-types. To support DateTime.MinValue
as described below, datetime2
is used in Sql2008 and Sql2012 in the Dates-indexes tables.
- [Changed]: Redesigned how the providerfactories are created. Also renamed the
ISisoDatabaseFactory
toISisoDbFactory
. - [Bug]: Fixed issues with incompatible features in the SQL2005 provider.
- New: Unsigned types has been verified to be stored in the JSON but is not tried to be stored in the indexes-tables. Hence you can use them but not query on them.
-
New: Session has gained a new
Status property
with valuesActive, Disposed, Failed, DisposedWithFailure
; useful if you put up e.g. a customized session-per-request feature and want to take certain actions depending on if the session has failed or not. -
New:
Session.DeleteAllExceptIds(ids)
lets you delete everything else but structures matching sent ids. -
New:
Session.Clear<T>()
lets you clear all structures of the certain type. -
New: Expression new supports
ToLower
andToUpper
on inline string values and not only string members. E.gi => i.Firstname == "DANIEL".ToLower()
. NOTE! This is not necessary unless you have a collation that is case-sensitive.
Released with the v14.0.0-pre1 release and left in the v14.0.0 final release:
- [Changed]: Support for
DateTime.MinValue
inSql2005
,Sql2008
andSql2012
by usingdatetime2
instead ofdatetime
. - [Changed]: Storing JSON dates in ISO8601 format. Old stored dates should still be consumable, but to be sure you could configure it to use old behavior, via
db.Configure().Serializer(cfg => cfg.DateSerializationMode = DateSerializationModes.TimestampOffset)
. - [Changed]:
Serializer.DeserializeManyInParallel
has been moved toSerializer.Options.DeserializeManyInParallel
which is easiest configured via API described below. -
New: You can now configure the Serializer via the configuration API. E.g.
db.Configure().Serializer(cfg => cfg.DateSerializationMode = DateSerializationModes.TimestampOffset)
. -
New: Sql2005 provider, there's now going to be an explicit
Sql2005
provider so that you don't have to use the Sql2008 provider. -
New:
QxIn query operator
used for building queries: Where member is in (x, y, z). Will use Table params where the provider supports it. E.gQuery<Team>.Where(x => Persons.QxAny(p => p.Points.QxIn(32, 33))
- [Fix]: When running queries using
x == null
where x isDateTime
.
- [Fix]: Exception when a Text member is null which shouldn't generally be a problem but in certain models this slips through; and that caused an exception. This has been fixed.
- [Fix]: SQLCE-provider couldn't store JSON larger than 4000chars. This has been fixed. The limitation in the SQLCE provider is 4000chars per single property, not per document.
Schema changes has been made. RowId has been added to all tables and indexes in value tables has been changed.
- [Fix]: Bug with query indexes in the SQLCE-provider. There was an index that messed up queries to be extremely slow.
- [Fix]: Bug with inserts of structures bigger than 4000 chars.
-
New:
Insert(type, object)
,InsertAs(type, object)
,InsertMany(type, objects)
- New: The hardcoded schema prefixing with "dbo" has been removed, so you can now have custom schemas used by using specific schemas assigned to the login used.
- [Breaking]: The ugly
Text
type that was required for storing long texts is gone and replaced with conventions. If your model contains a property with typestring
where the name ends withText | Content | Description
; this can be replaced via:db.StructureSchemas.SchemaBuilder.DataTypeConverter.MemberNameIsForTextType = name => name.EndsWith("Foo");
- [Breaking]: Removed the
Db.Maintenance.SetRowIdsOn(); Db.Maintenance.SetRowIdsOn();
and instead putting inRowIds
from the start, this is done to enable replication be default and meet the requirement of having a clustered index in Azure. Also, to avoid table scans in certain locking scenarios.
- [Breaking]: If using identities, you will for those Structure-tables, have to make the clustered index associated with the
StructureId
column, non clustered. Tip! Setup a clean database from with the new SisoDb version and do a schema compare. - [Breaking]:
DbSchemaNamingPolicy
now only supports prefixes. More info -
New:
Db.Maintenance.SetRowIdsOn();
Will add a field called RowId to all tables. It will also (if the provider supports it)create a clustered index against this field, so that you could use replication, Azure etc. -
New:
Db.Maintenance.SetRowIdsOff();
Will remove the RowId field and associated index from all data tables. -
New:
SisoDb.Diagnostics.DbDiagnosticsContextBuilder.Build() : DiagnosticsContext
- Used to build diagnostics info per database. More info. -
New:
SisoDb.Glimpse.SisoDbGlimpsePlugin
- used to extract diagnostics info for display using Glimpse. Read more about the SisoDbGlimpsePlugin. -
New:
SisoDb.Configurations
lets you easily configure a database, e.g.db.Configure().UseManualStructureIdAssignment();
Read more - [Tweaked]: Made the expression parsing faster.
- [Updated]: Updated to the latest version of ServiceStack.Text
- New: You can now create projections using expressions.
-
New: A new Db-Setting is been added:
AllowUpsertsOfSchemas
; If you know your database already contains all tables, you can gain a small performance boost, the first time (perISisoDatabase
) that you access a certain type of structure. -
New:
Exists<T>(id)
has been re-added toISession
. Read more.
The new named query feature has been blogged about here.
-
New: You can now let SisoDb Create stored procedures for you using expressions, making them refactoring friendly, via
session.Advanced.UpsertNamedQuery<T>(name, expression)
. Read more -
New: You can now consumed named queries using expressions, making them refactoring friendly, via
session.Advanced.NamedQuery<T>(name, expression)
. Read more -
New: If you just need to fire away some non query SQL against the DB, you can now do this via:
session.Advanced.NonQuery
- [Fix]: Bug with includes
- [Tweak]: Some minor tweaks for queries and the use of params
- [Fix/Tweak]: When synchronizing models against the DB there were to many questions being fired, even if they only are done once per
ISisoDatabase
instance, it's now reduced to one query per structure. By the way. A small tip. If you know your DB is upserted correctly, you can turn synchronization checks of.
-
New: By using the SisoDb.Dynamic package you can now write queries like:
session.Query(type).Where("x => x.Name == \"Daniel Wertheim\"")
Read more about how it can be used in conjunction with XSockets and Websockets. Documentation is located here. -
New: Added some helper methods to go from a connection string or connection string name to an
ISisoDatabase
. Import the namespace of one of the providers and you should be able to do:"ConnectinStringOrName".CreateSql2012Db();"
.
- [Updated]: The SisoDb.MiniProfiler package is now updated to work against the latest MiniProfiler package
- New: Introduced new package SisoDb.Dynamic which as of now is used to support dynamic queries for the SisoDbClient.Js
Yes that's right. There's already a new release of SisoDb with new features. This time, we introduce a new package: SisoDb.MiniProfiler, which lets you activate the MiniProfiler in SisoDb.
New - New package SisoDb.MiniProfiler. Read more: Using MiniProfiler in SisoDb
- [Changed] - Operations
Count
andExists
has been moved toISisoQueryable
, hence you now access it via:Db.UseOnceTo().Query<Person>().Count([expression])
session.Query<Person>().Count([expression])
Db.UseOnceTo().Query<Person>().Exists(id)
session.Query<Person>().Exists(id)
- [Changed] -
DbShemaNamingPolicy.StructureNameGenerator
for custom table naming now takesstring
instead ofIStructureSchema
. - [Changed] - The code base of the excellent serializer framework ServiceStack.Text is now included as in
SisoDb.Serialization
instead of taking dependency on the ServiceStack.Text NuGet package. SisoDb will still continue to use it but included as source code. - [Changed] - Cache providers now uses same version as the other projects in the SisoDb family.
-
New - Db.Maintenance - used for performing maintenance tasks against your db. Like renaming structures, migrations, reindexing etc. New operations are:
RenameStructure(string from, string to)
RegenerateQueryIndexesFor<T>()
Migrate<TFrom, TTo>(Func<TFrom, TTo, MigrationStatuses> modifier)
Migrate<TFrom, TTo>(Migration<TFrom, TTo> migration)
Migrate<TFrom, TFromTemplate, TTo>(Migration<TFrom, TFromTemplate, TTo> migration)
-
New - Db.Settings - contains some settings that you can tweak to change some of SisoDb's behavior. E.g:
MaxInsertManyBatchSize : int
MaxUpdateManyBatchSize : int
SynchronizeSchemaChanges : bool
-
New -
ISisoQueryable.Any([expression])
which is accessed viaDb.UseOnceTo().Query<Person>().Any([expression])
session.Query<Person>().Any([expression])
-
New -
Db.UseOnceTo()
now has non generic versions of Inserts, Updates and Deletes, useful if you e.g are loading types dynamically at runtime. -
New - Query with
String.Contains
now works hence you don't need to useString.QxContains
anymore. E.gDb.Query<Person>().Where(p => p.Name.Contains("a"))
- [Fix] -
ISisoQueryable<T>.Count()
- Now doesn't clear any expression assigned before, henceQuery<Person>().Where(p => p.Name == "Daniel").Count()
now will count every Person with Name being equal to "Daniel". - [Fix] -
Db.UseOnceTo().Query<T>.Count(expression)
didn't clear any existing predicate. - [Fix] -
Qyery<Article>().Where(a => a.Name.QxStartsWith('B') || a.PLU == 42 || Tags.QxAny(i == "Entertainment")
- Had inner joins instead of left.
- Fix - When updating or inserting items that has nested element in array with single string member being null.
- Fix - StructureId in the Structure table is now non clustered and single update operation is now doing an actual update of the Structure-table instead of delete and insert. You need to change existing structure tables manually to use non clustered primary keys.
This release has been about making parts of the API (mostly of the ISession) non generic. E.g Session.Insert(typeof(Customer), item)
The reason for this is that I'm working on a socket server, based on XSockets which can e.g be used to consume SisoDb using JavaScript from a plain old Html page. More about that when finished.
- Fix - When having cache enabled and using
Session.Exists<T>(id)
the cache had no fallback on Db if item didn't exist in cache.
- New -
Cache.Any()
,Cache.Count()
andCache.GetAll()
- Fix - A Session shall not try to put structures in cache if they are null
- Fix -
GetByIds
returned to many structures when used in conjunction with cache - Fix -
GetByIds
not returning structures - Fix -
GetByIds
should not return individual structures being null - Fix - Framework dependencies in cache providers
- New - Simplified connectionstring to not require
sisodb
andplain
parts. Eg:new Sql2008ConnectionInfo("sisodb:[sisodb-config]||plain:[normal connectionstring]")
is nownew Sql2008ConnectionInfo("[normal connectionstring]")
- New -
SisoDb.AspWebCache v0.1.0
andSisoDb.MsMemCache
now exists as two cache providers implemented over the Asp Cache and the MemoryCache. - Fix - If really unlucky the warmup behavior of the SqlCe4ConnectionManager could have caused an extra connection to be opened.
The 10.0 and 10.0.1 release was only a pre-release and after using it some adjustments has been made and this release, v10.1.0 is not a pre-release.
-
Removed/Changed - The pre-release had replaced ADO.Net transactions for Transaction-scopes. This was done to support parallel inserts of indexes. Since this was something that needed DTC's and that brought unnecessary complexity to the code-base, it has been removed and the code has reverted back to use ADO.Net transactions. Transaction-scopes are still supported. The
ParallelInserts=On|Off
support has been removed. And will be replaced byBackgroundIndexing=Off|InProc|Service|Custom
, which is a coming v10.x feature. -
New - SisoDb now supports time-stamps. You enable support for them by adding a single property to your class. By doing that you enable SisoDb to assign a value to it upon inserts and updates.
public DateTime StructureTimeStamp { get; set; }
public DateTime [ClassName]TimeStamp { get; set; }
public DateTime I[InterfaceName]TimeStamp { get; set; }
public DateTime TimeStamp { get; set; }
While currently using SisoDb in a distributed enterprise solution using CQRS we have identified the need of concurrency handling as well as isolated/exclusive updates, hence that has been the focus of this release. There has also been focus on making the API simpler, which also means that some functions has been removed. If you miss them, ping me, and they will go in in some form again.
- New - ConcurrencyToken support for updates. Just include a member
public Guid|int|long ConcurrencyToken { get; set; }
and you are done. - New -
Update<T>(id, Action<T> modifier)
- Keeps the scope down and uses rowlocking behavior to not let others get a document for update until first operation is complete. Note! In SQLCE4, you will still be able to select the document and concurrently store it viaUpdate(item)
but not in SQL2008 and SQL2012. This is due to SQLCE4 using nolock perdefault. You will how-ever not be able to useUpdate<T>(id, Action<T> modifier)
for the same document in any of the providers. More info - New -
Update<T>(id, Action<T> modifier, Func<T, bool> proceed)
same as above but it lets you abort the update gracefully. This is useful, e.g. in a situation where you can get concurrent messages in a denormalizer and you only want the "later" versions of it stored. More info - New - Insert of anonymous types via
InsertTo<TContract>(object item)
whereitem
can be complete or partial match of interface. Useful when storing viewmodels that has lookupdata etc. that should not be stored. More info - New - Connection string now supports
ParallelInserts=On|Off
(default is Off) which lets you enable parallel inserts of structures and indexes. Not supported by SqlCe4. - New -
GetById
constructs returning JSON is now also consuming the Cache. - Changed -
BeginWriteSession
andBeginReadSession
is nowBeginSession
- Changed - Transactions are now purely using
TransactionScopes
which is automatically created for each session and is nothing you have to think of. You can override the behavior and instead create a larger scope, e.g containing two sessions by usingDb.ProviderFactory.GetRequiredTransaction
orDb.ProviderFactory.GetSupressedTransaction
. - Changed -
Db.ReadOnce()
andDb.WriteOnce()
are replaced byDb.UseOnceTo()
- Changed - Server connections for SQLCE will automatically get
Enlist=false
while client connections will getEnlist=true
. - Changed -
DeleteByQuery
andUpdateMany
is moved toAdvanced
. - Changed - Members of
Session.Advances
e.g.RawQuery
andNamedQuery
is no longer found underDb.UseOnceTo()
. You can only access these via aSession
. - Removed -
GetByIdInterval
andDeleteByIdInterval
has been removed. It only works nicely when using identities, hence it has been removed. - Fix - When using unique constraints, inserts have been tweaked to not always use bulk inserts, since it causes overhead when dealing with low number of inserts.
- New - Sql2012 provider
- New - when Querying Json you can now deserialize to anonymous types.
- New - Possibility of hooking in a Cache provider on a database, which will be used in
GetById
,GetByIds
andExists
- New - Deserialize to anonymous types via
ToEnumerableOf
,ToArrayOf
andToListOf
now gives you the ability to pass in an anonymous type template which is used when deserializing. - New - Added simple
bool Exists(id)
. - Bug - When storing big strings (Texts) with escaped contents, it wasn't escaped (fix in ServiceStack.Text Serializer).
- Not requiring
IList<T>
forInsertMany
anymore. JustIEnumerable<T>
. - Added option
JsonSerializer.DeserializeManyInParallel
which defaults to true - Performance tweaks
- Fixed issue of doing a single insert of a structure having a single value-type index that is null.
Just small bug fixes.
- Fixed bug only supporting implicit bool statements.
- Fixed bug with
GetByIds
not accepting e.gGuid[]
Breaking changes not only in API but also in Db-schema. For more detailed info on migrations etc. look here: http://daniel.wertheim.se/2012/01/17/sisodb-v9-0-released/
- New index storage layout with new indexes to improve query speed
- New type
Text
to support strings longer than 300chars. - New
DbSchemaNamingPolicy
for being able to control naming of tables - Verified Sql2008 provider against Sql2012 RC0 (Denali)
- Rewrote queries to get rid of fields: RowId and EntityHash in database
- Renamed
QueryEngine
andUnitOfWork
toReadSession
andWriteSession
. Note!WriteSession
is still transactional when the provider allows it. - Explicit
Commit
has been removed.WriteSession
is now using auto-commit, if no exceptions has been encountered - Overload of
UpdateMany<TOld, TNew>
replaced byDbStructureSetMigrator.Migrate<TOld, TNew>
- Removed dependency on SqlCEBulkCopy project
- Fixed bug with
ToArray()
andFirst()
onReadOnce
operations. - Fixed bug with querying on enums
- Fixed indexes
- Fixed issue with update many removing last item
- Added support for checking for connectionstrings with key prefixed by "[MachineName]_connectionstringname" before trying to resolve via "connectionstringname".
Had to make a small change that might brake things for you. If you store something e.g IPerson but passes a Person object that has more properties defined. Now, every member of the Person object will be serialized in the JSON string. The index generation is left as before, and only members of IPerson are indexed (made availible for querying).
- Now serializes all members of passed object
- Now supports custom id names like
PersonId
andId
instead of onlyStructureId
.
There has been some various small releases since v7.0. Mostly fixing bugs and features related to querying.
- Fixed bug with throwing exception when you try to add specific configuration for a type, like IndexOnlyThis(c => c.CustomerNo)
- Fixed issue with QueryAPI, where QueryEngine listed members taking an IQuery. This is low level and has been moved to QueryEngine/UnitOfWork.Core
- Re/added GetStructureSchema on QueryEngine and UnitOfWork
- Fixed issue with accidentally including dll's that where referenced as packages.
- Fixed support for
ToString().StartsWith()
andToString().EndsWith()
for use with e.g nullable value types. - Added more evaluators to
ISisoQueryable<T>
- First, FirstAs, FirstAsJson
- FirstOrDefault, FirstOrDefaultAs, FirstOrDefaultAsJson
- ToArray, ToArrayOf, ToArrayOfJson
- Replaced QueryAPI and made it behave more like IQueryable. E.g
Query<T>().Where().OrderBy().Page().ToList()
- Chained queries, you can now build a query in multiple steps, calling e.g Where() several times.
- Implemented Raw queries so that you can use raw parameterized SQL, useful if the lambdas doesn't cover your needs.
- Implemented better support for nullable value types in query expressions.
-
Db.UpdateStructureSet
has been replaced withUnitOfWork.UpdateMany
- New: Added UnitOfWork.GetSchema so that you can get them if you only have access to your UnitOfWork and not only the SisoDatabase.
Since table design has changed and some public API changes are changed, version has been bumped.
- New: Support for strings as Ids. Max length is 16 unicode chars.
- New: SqlCe4 now supports uber long json content instead of previously 4000 chars
- New: Using latest PineCone you can now select different StructureBuilders, always setting new Id or keeping.
- New: Db.StructureBuilders holds funcs that determines how to create a StructureBuilder for a certain StructureSchema, so that you can configure this per type.
- New: Using latest PineCone there is SequentialGuidGenerator (default) or GuidGenerator that could be assigned to StructureBuilder.StructureIdGenerator
- New: Opened API up in Database so that parts could be switched out.
- [Update]: Query extension methods (e.g [stringmember].QxStartsWith(string)) has moved up from
SisoDb.Querying
toSisoDb
- [Update]: ReadOnce and WriteOnce, aren't extensionmethods of
ISisoDatabase
anymore, but instead members of it. - [Fix]: Rewriten sql to not using min(json) anymore
- [Fix]: When inserting as Interface and implementation references other structures, they are not included in the Json anymore.
- [Fix]: Performance but more importantly security of GetByIds and DeleteByIds in SqlCe4
- [Fix]: Removed unneccesary steps in Updates to increase performance.
- [Fixed] order by bug, when sorting on two different fields of same type.
- [Fixed] so that caching of SqlCe4Connections now could be several per connectionstring
- New supports string.ToLower, string.ToUpper
- New supports string.QxToLower, string.QxToUpper
- New supports string.StartsWith, string.EndsWith
- New supports <, <=, >, >= in enumerable.QxAny()
- [Fixed] Updated to latest version of PineCone to get threadsafe structureschemas collection.
- [Fixed] When issuing database commands like
EnsureNewDataBase
the cached structure schema wasn't removed - [Fixed] Bug in caching of SqlCe providers connections.
- [Fixed] Better performance when doing single inserts.
- [Fixed] Bug with not supporting Enums when creating indexes. Now it is supported.
- [Fixed] Fixed the SqlCe4 package, it was missing two dependencies.
- [Fixed] After rewrite in v4.0, no upper limit existed for the batchsize of Indexes sent to the bulkinserter.
- [Updated] GetByIdInterval is not supported if Id-type is not Guid.
- [Updated] Moved NamedQuery methods to QueryEngine.Advanced
- [Updated] NO MORE CLIENT PROFILE
- [Updated] Updated ServiceStack.Text to last version.
Major rewrite. The generation of StructureSchemas and Structures (graph of indexes) now lives in project: PineCone. http://github.com/danielwertheim/pinecone The querying table (Indexes) is now key-value which will open up for better querying support. Reworked internals to become more generic to simplify writings of additional providers.
- [Fixed] A connection could sometimes get left in a open state.
- [Fixed] Bug when Including other Json documents in the same result (Merged Documents).
- [Updated] ServiceStack.Text updated from v2.2.7 to v3.0.0.
- [Updated] SisoId is now StructureId both in classes as well as in storage schema.
- [Updated] Storage schema for Indexes are now key-value.
- [Updated] Storage schema for Uniques now have UqMemberPath instead of UqName
- [Updated] All members of QueryEngine and UnitOfWork taking Enumerable of Ids, now takes param array of ids instead. E.g. GetByIds, DeleteByIds etc
- [Updated] StructureSetUpdater should not be used individually, but via Database.UpdateStructureSet.
- [Updated] The support for how Uniques are handled has been changed. The property marked as unique is turned into a hashed string before stored. That way we get uniformed lenght strings.
- [Updated] As a security precausion, DeleteByIdInterval is now only supported when you use Identities and not Guids.
- New SqlCE4 support, except from TransactionScopes. Support is on its was. NORMAL TRANSACTIONS ARE OF COURSE SUPPORTED THOUGH!
- New The Id (previous SisoId) now StructureId now does support Guid, int, long and Nullable, Nullable, Nullable
- New HashSets and Dictionaries are now supported
- New Extensionpoints for QueryEngine and UnitOfWork now exists on ISisoDataBase via ReadOnce() and WriteOnce(). These simpliefies working with QueryEngine/UnitOfWorks BUT SHOULD ONLY BE USED WHEN DOING ONE OPERATION AGAINST QueryEngine or UnitOfWork.
- [Fixed] Single Insert method on UnitOfWork does not forward call to InsertMany anymore. Hence for "UoW.Insert" no bulk insert is performed, which leads to less overhead; while "UoW.InsertMany" still makes use of bulkinserts.
- New Foreign-keys and relations are now used between Structure, Indexes and Uniques table.
- [Updated] IMPORTANT! Skiped "Providers" in the namespace for each provider plugin and rearranged some internal code.
- [Updated] Latest release of ServiceStack.Text, which now is resolved as a NuGet package.
- New IMPORTANT! As of now SisoDb has been divided in a core assembly "SisoDb" and a provider assembly "SisoDb.Providers.Sql2008". Other providers are work in progress.
- New NuGet Id for Sql2008 provider is "SisoDb.Sql2008".
- [Fixed] QxAny now can be used on nested enumerables but it only support operators: (== and !=), if non supported operator is used, a SisoDbException will be thrown.
- New SisoDbFactory has been replaced by specific Db-factories lying in the provider of your choice, e.g Sql2008 uses Sql2008DbFactory, which currently is the only finnished provider.
- New Now lets you nest UnitOfWorks in TransactionScopes. When doing that, Commit and rollbacks are controlled by the TransactionScope.
- [Fixed] When assigning SisoId values, the parallelization messed up the ordering. This has been corrected. The generation is now sequential.
- New IMPORTANT! When inserting items any assigned SisoId-values will not be preserved. This is done because you shouldn't mess up the sequential order of the Guids or the identities. If you do need to preserve values. Let me know.
- New IMPORTANT! Database.CreateQueryEngine : IQueryEngine - Should be used for querying instead of the UnitOfWork retrieved by Database.CreateUnitOfWork. You should only use the UnitOfWork for querying when you need to query structures within the same transaction.
- New IMPORTANT! Naming conventions on primary keys for Structure-table (PK_CustomerStructure) and Indexes-table (PK_CustomerIndexes). If this isn't applied, Database.UpdateStructureSet below will not work.
- New Database.UpdateStructureSet will now perform a rebuild of primary key indexes after the process is done. This is done since Id-values might be reused during this process.
- New GetByIds, GetByIdsAsJson, GetByIdsAs - Lets you return multiple structures based on a set of multiple ids. (http://sisodb.com/docs/doc16)
- New GetByIdInterval - Lets you return multiple structures having ids matching a defined interval. (http://sisodb.com/docs/doc16)
- New DeleteByIds - Lets you delete multiple structures by specifying a set of ids to delete. (http://sisodb.com/docs/doc5)
- New DeleteByIdInterval - Lets you delete multiple structures having ids matching a defined interval. (http://sisodb.com/docs/doc5)
- New Count(lambda expression) - Lets you execute a count on structures matching a boolean lambda expression. (http://sisodb.com/docs/doc14)
- [Fixed] Fixed overconsumption of memory while inserting big batches of items.
-
New You can now specify explicitly what to index or what not to index. This will of course result in that fields not being indexed, is not queryable. This is something you might want to do to get better performance. You can always reindex the data using DataBase.UpdateStructureSet (http://sisodb.com/docs/doc13) NOTE! The values are cached per database. The new functionality lies under Database.StructureSchemas.StructureTypeFactory.Configurations (http://sisodb.com/docs/doc15)
-
New Redesigned the internals so you can now access. SisoEnvironment.ResourceContainer and assign new resolvers to your specific implementations of some resource.
-
[Fixed] There was an bug in how the Unique constraints where handled. This have been fixed but you need to update all Uniques table.
You should be able to do this with the db.UpdateStructureSet method (http://sisodb.com/docs/doc13) E.g: 1) Drop the Uniques table 2) Handle any rows from Structure-table and Indexes-table that might cause an Unique-violation. 3) Run: db.UpdateStructureSet<Customer, Customer>((oldCustomer, newCustomer) => StructureSetUpdaterStatuses.Keep); You can also do this via T-Sql. All tables [x]Uniques should now have four columns: 1) SisoId int|uniqueidentifier not null 2) UqSisoId int|uniqueidentifier null 3) UqName [nvarchar](250) not null 4) UqValue [varchar](100) not null
- [Update] Performance optimizations, not using Reflection to extract values for indexing anymore. Now using ILGeneration instead.
- [Update] Using NuGet to resolve ServiceStack.Text dependency.
- [Update]: Reworked the Property (new name StructureProperty) extraction and value accessing.
- [Update]: Started to push demand of generics upwards the stack.
- [Added]: NuGet spec file.
- New: IMPORTANT! Demand of property Id of type int or guid has now become "SisoId".
- [Update]: Moved some namespaces but the ordinary consumer should not be affected about this.
- New: Query API now supports Paging. Eg. uow.Query(q => q.Page(pageIndex: 0, pageSize: 10))
- New: Query API now supports Take number of structures. Eg. uow.Query(q => q.Take(10).Where(c => c.CustomerNo == "12345"))
- [Update]: Latest version of ServiceStack for Json serialization.
- [Update]: Minor update for not relying on reflection but instead use Func's to extract and set Id's.
- New: If a Structure contains another Structure (one with an Id) it will not be serialized and indexed since this structure should be stored on it's own.
- New: UnitOfWork now supports Json inserts via: InsertJson, InsertManyJson. NOTE! If you have instances of an entity, it's more effective to pass it in instead of raw json.
- New: You can now use Database.UpdateStructureSet<TOld, TNew> with completly different types to go from lets say, SalesPerson to SalesMen and a also remap properties.
- New: Now uses Sequential GUIDs to boost performance.
- New: UnitOfWork now offers the simplified Where methods again.
- [Update]: UpdateStructureSet - Better performance by deleting by id-range and not per id. [Update]: set nocount on.
- New: Database.UpdateStructureSet (uses SqlStructureSetUpdater under the hood), which lets you pass in oldmodeldefinition and a new modeldefinition and then you can map new propertynames etc. Changes are performed within a transaction.
- [Fixed]: IMPORTANT! Identities where not being preserved when issuing an update.
- [Removed]: IMPORTANT! The UnitOfWork Where methods has been removed. You will have to use the Query API instead. E.g uow.Where(expression) now becomes uow.Query(q => q.Where(expression))
- New: You can now Include firstlevel single child structures in the same resultset from the database so that you don't have to do multiple queries/roundtrips. You can do this via the GetAll and Query methods using the command builder's IncludeMethod. NamedQueries works to. Return several fields with Json, where the first one should be named "Json". After that, alias should be the name of the property in the root structure.
- New: Lambda expressions for querying now supports nullable types.
- [Update]: The UnitOfWork.Query, QueryAs, QueryAsJson methods, taking an ordinary expression is now called Where, WhereAs, WhereAsJson, since the Query overload taking an IQueryCommand got blured/tangled with the one taking an expression.
- [Update]: SisoDatabase has been replaced with SisoDbFactory.CreateDatabase
- [Fixed]: bug of not being able to use lambdas with complex types.
- [Fixed]: You can now query Id'values using Lambdas, since it's now translated to StructureId as the column is named in Indexes-table.
- [Update]: DeleteById doesn't return bool anymore.
- New: DeleteByQuery - You can now delete other than single item by Id and instead pass a query and delete all items matching that query.
- New: Now able to specify sorting when querying using: Query, QueryAs, QueryAsJson, GetAll, GetAllAs, GetAllAsJson