Skip to content

Releases: danielgindi/SequelNet

Added `Subtract` to PhraseHelper

23 Oct 16:31
Compare
Choose a tag to compare

Fix for LIKE escaping issue

25 Sep 14:48
Compare
Choose a tag to compare

Where % and ' where not escaped correctly and could miss search results

MySql JSON support improvements

25 Jun 14:10
Compare
Choose a tag to compare
  • Added more phrases for json handling
  • Fixed a bug with Guid values - will only TryParse into Guid values, and allow partial lookups (with LIKE etc)

Support CommandTimeout on a per Query basis

28 May 17:39
Compare
Choose a tag to compare

Improved spatial types support for Mysql 8.0

28 May 13:49
Compare
Choose a tag to compare

Support for Mysql 8.0, updated postgres dependency

05 May 19:46
Compare
Choose a tag to compare

More transaction safety

16 Apr 05:56
Compare
Choose a tag to compare

Don't count on connection provider, as I've encountered some issues with MySql's implementation in some situations.

More spatial phrases (ST_X, ST_Y)

11 Feb 21:30
Compare
Choose a tag to compare

Migrations support

28 Jan 06:11
Compare
Choose a tag to compare

A simple migrations mechanism. Leverage the existing querying features to do migrations also.

So to define a migration:

[Migration(20190127135100, "A sample migration")]
public class SampleMigration : Migration
{
    public override void Up()
    {
        // Some queries here
    }

    public override void Down()
    {
        // Some queries here
    }
}

And to start a migration flow:

var migrationController = new MigrationController();

migrationController.LoadMigrationsFromAssembly(this.GetType().Assembly);

migrationController.VersionQueryHandler = () =>
{
    try
    {
        var version = Query.New<SchemaGlobals>()
            .Select(SchemaGlobals.Columns.Data)
            .Where(SchemaGlobals.Columns.Key, "version")
            .LimitRows(1)
            .ExecuteScalar() as string;
        if (version == null) return 0;
        return Convert.ToInt64(version);
    }
    catch
    {
        Query.New<SchemaGlobals>().CreateTable().Execute();
        return 0;
    }
};

migrationController.MigrationVersionEvent += (sender, args) =>
{
    Query.New<SchemaGlobals>()
        .Insert(SchemaGlobals.Columns.Key, "version")
        .Insert(SchemaGlobals.Columns.Data, args.Version)
        .InsertOrUpdate()
        .Execute();
};

migrationController.ItemStartEvent += (sender, args) =>
{
    logger.Info($"Migrating db to version {args.Version}: {args.Description ?? args.Type.Name}...");
};

migrationController.ItemEndEvent += (sender, args) =>
{
    logger.Info($"Migrating db to version {args.Version}: {args.Description ?? args.Type.Name} - Done.");
};

try
{
    var count = migrationController.MigrateUp();

    if (count > 0)
    {
        logger.Info($"Successfully ran {count} migrations.");
    }
}
catch (Exception ex)
{
    logger.Error(ex, "Migration failed.");

    try
    {
        migrationController.Rollback();
    }
    catch (Exception rex)
    {
        logger.Error(rex, "Migration rollback failed.");
    }
}

New phrases, more OrderBy overloads

23 Nov 16:15
Compare
Choose a tag to compare
  • DateTimeDiff phrase
  • Abs phrase
  • Greatest phrase
  • Least phrase
  • New OrderBy overloads