Skip to content

Commit

Permalink
Merge pull request #17 from akkadotnet/dev
Browse files Browse the repository at this point in the history
v0.90.1 release
  • Loading branch information
Aaronontheweb authored Feb 3, 2021
2 parents 9a89bb0 + 3a08414 commit e06499a
Show file tree
Hide file tree
Showing 25 changed files with 93 additions and 14 deletions.
14 changes: 12 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
#### 0.1.0 October 05 2019 ####
First release
#### 0.90.1 Feb 3 2021 ####
**Preview Release for Akka.Persistence.Linq2Db**

Akka.Persistence.Linq2Db is an Akka.Net Persistence plug-in that is designed for both high performance as well as easy cross-database compatibility.

This is currently marked as a preview release, with tests passing for MS Sql Server, Postgres, and SQLite. We are looking for community help with adding tests, as well as trying out the new plugin and [providing feedback](https://github.com/akkadotnet/Akka.Persistence.Linq2Db/issues).

There is a compatibility mode also available for those who wish to migrate from the existing Sql.Common journals.

[Please refer to the project page](https://github.com/akkadotnet/Akka.Persistence.Linq2Db/) for information on configuration.


8 changes: 4 additions & 4 deletions build-system/windows-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ variables:
- group: signingSecrets #create this group with SECRET variables `signingUsername` and `signingPassword`
- group: nugetKeys #create this group with SECRET variables `nugetKey`
- name: githubConnectionName
value: yourConnection #replace this
value: AkkaDotNet_Releases
- name: projectName
value: yourProjectName #replace this
value: Akka.Persistence.SqlServer
- name: githubRepositoryName
value: yourOrganization/yourRepo #replace this
value: akkadotnet/Akka.Persistence.Linq2Db

steps:
- task: BatchScript@1
displayName: 'FAKE Build'
inputs:
filename: build.cmd
arguments: 'nuget SignClientUser=$(signingUsername) SignClientSecret=$(signingPassword) nugetpublishurl=https://www.nuget.org/api/v2/package nugetkey=$(nugetKey)'
arguments: 'nuget nugetpublishurl=https://www.nuget.org/api/v2/package nugetkey=$(nugetKey)'

- task: GitHubRelease@0
displayName: 'GitHub release (create)'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class = ""{0}""
use-clone-connection = true
tables.journal {{
auto-init = true
warn-on-auto-init-fail = false
table-name = ""{2}""
}}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class = ""{0}""
use-clone-connection = true
tables.journal {{
auto-init = true
warn-on-auto-init-fail = false
table-name = ""{2}""
}}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class = ""{typeof(Linq2DbSnapshotStore).AssemblyQualifiedName}""
{{
snapshot {{
auto-init = true
warn-on-auto-init-fail = false
table-name = ""{tablename}""
}}
}}
Expand Down Expand Up @@ -94,6 +95,7 @@ class = ""{typeof(Linq2DbWriteJournal).AssemblyQualifiedName}""
table-compatibility-mode = ""sqlserver""
tables.journal {{
auto-init = true
warn-on-auto-init-fail = false
table-name = ""{tablename}""
metadata-table-name = ""{metadatatablename}""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class = ""{typeof(Linq2DbSnapshotStore).AssemblyQualifiedName}""
{{
snapshot {{
auto-init = true
warn-on-auto-init-fail = false
table-name = ""{tablename}""
}}
}}
Expand Down Expand Up @@ -94,6 +95,7 @@ class = ""{typeof(Linq2DbWriteJournal).AssemblyQualifiedName}""
table-compatibility-mode = ""sqlite""
tables.journal {{
auto-init = true
warn-on-auto-init-fail = false
table-name = ""{tablename}""
metadata-table-name = ""{metadatatablename}""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public static Config Config(int id)
table-name = event_journal
metadata-table-name = journal_metadata
auto-init = true
warn-on-auto-init-fail = false
}}
}}
connection-string = ""{connString}""
Expand All @@ -49,6 +50,7 @@ public static Config Config(int id)
journal {{
table-name = event_journal
metadata-table-name = journal_metadata
warn-on-auto-init-fail = false
}}
}}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public static Config Config(int id)
table-name = event_journal
metadata-table-name = journal_metadata
auto-init = true
warn-on-auto-init-fail = false
}}
}}
connection-string = ""{connString}""
Expand All @@ -49,6 +50,7 @@ public static Config Config(int id)
journal {{
table-name = event_journal
metadata-table-name = journal_metadata
warn-on-auto-init-fail = false
}}
}}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class = ""{typeof(Linq2DbWriteJournal).AssemblyQualifiedName}""
table-name = event_journal
metadata-table-name = journal_metadata
auto-init = true
warn-on-auto-init-fail = false
}}
}}
}}
Expand All @@ -66,6 +67,7 @@ class = ""{typeof(Linq2DbWriteJournal).AssemblyQualifiedName}""
table-name = event_journal
metadata-table-name = journal_metadata
auto-init = true
warn-on-auto-init-fail = false
}}
}}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class = ""{typeof(Linq2DbWriteJournal).AssemblyQualifiedName}""
tables {{
journal {{
table-name = event_journal
warn-on-auto-init-fail = false
metadata-table-name = journal_metadata
auto-init = true
}}
Expand All @@ -65,6 +66,7 @@ class = ""{typeof(Linq2DbWriteJournal).AssemblyQualifiedName}""
journal {{
table-name = event_journal
metadata-table-name = journal_metadata
warn-on-auto-init-fail = false
}}
}}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public static Config Config(int id)
table-name = event_journal
metadata-table-name = journal_metadata
auto-init = true
warn-on-auto-init-fail = false
}}
}}
}}
Expand All @@ -53,6 +54,7 @@ public static Config Config(int id)
journal {{
table-name = event_journal
metadata-table-name = journal_metadata
warn-on-auto-init-fail = false
}}
}}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public static Config Config(int id)
table-name = event_journal
metadata-table-name = journal_metadata
auto-init = true
warn-on-auto-init-fail = false
}}
}}
}}
Expand All @@ -51,6 +52,7 @@ public static Config Config(int id)
journal {{
table-name = event_journal
metadata-table-name = journal_metadata
warn-on-auto-init-fail = false
}}
}}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public static Config Config(int id)
table-name = event_journal
metadata-table-name = journal_metadata
auto-init = true
warn-on-auto-init-fail = false
}}
}}
connection-string = ""{connString}""
Expand All @@ -57,6 +58,7 @@ public static Config Config(int id)
journal {{
table-name = event_journal
metadata-table-name = journal_metadata
warn-on-auto-init-fail = false
}}
}}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public static Config Config
table-name = event_journal
metadata-table-name = journal_metadata
auto-init = true
warn-on-auto-init-fail = false
}}
}}
}}
Expand All @@ -81,6 +82,7 @@ class = ""Akka.Persistence.Sqlite.Snapshot.SqliteSnapshotStore, Akka.Persistence
journal {{
table-name = event_journal
metadata-table-name = journal_metadata
warn-on-auto-init-fail = false
}}
}}
write-plugin = ""akka.persistence.journal.linq2db""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class = ""{0}""
use-clone-connection = true
tables.snapshot {{
auto-init = true
warn-on-auto-init-fail = false
table-name = ""{2}""
}}
}}
Expand Down Expand Up @@ -91,6 +92,7 @@ class = ""{0}""
use-clone-connection = true
tables.journal {{
auto-init = true
warn-on-auto-init-fail = false
table-name = ""{2}""
}}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ class = ""{0}""
#connection-string = ""FullUri=file:test.db&cache=shared""
provider-name = ""{2}""
use-clone-connection = false
tables.journal {{ auto-init = true }}
tables.journal {{
auto-init = true
warn-on-auto-init-fail = false
}}
}}
}}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class = ""{0}""
#use-clone-connection = true
tables.journal {{
auto-init = true
warn-on-auto-init-fail = false
table-name = ""{2}""
}}
}}
Expand All @@ -40,7 +41,7 @@ public static Configuration.Config Create(string connString, string tableName, i

public static class SQLServerSnapshotSpecConfig
{
public static string _journalBaseConfig = @"
public static string _snapshotBaseConfig = @"
akka.persistence {{
publish-plugin-commands = on
snapshot-store {{
Expand All @@ -57,6 +58,7 @@ class = ""{0}""
#use-clone-connection = true
tables.snapshot {{
auto-init = true
warn-on-auto-init-fail = false
table-name = ""{2}""
column-names {{
}}
Expand All @@ -68,7 +70,7 @@ class = ""{0}""
public static Configuration.Config Create(string connString, string tableName, int batchSize = 100, int parallelism = 2)
{
return ConfigurationFactory.ParseString(
string.Format(_journalBaseConfig,
string.Format(_snapshotBaseConfig,
typeof(Linq2DbSnapshotStore).AssemblyQualifiedName,
connString,tableName,batchSize, parallelism));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class = ""Akka.Persistence.Sql.Linq2Db.Journal.Linq2DbWriteJournal, Akka.Persist
tables{{
journal{{
auto-init = true
warn-on-auto-init-fail = false
table-name = ""{journalTableName}""
metadata-table-name = ""{metadatatablename}""
}}
Expand All @@ -32,6 +33,7 @@ public static string _journalBaseConfig(string tablename, string metadatatablena
tables{{
journal{{
auto-init = true
warn-on-auto-init-fail = false
table-name = ""{tablename}""
metadata-table-name = ""{metadatatablename}""
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ class = ""{0}""
provider-name = ""{2}""
parallelism = 1
max-row-by-row-size = 100
tables.journal {{ auto-init = true }}
tables.snapshot {{
auto-init = true
warn-on-auto-init-fail = false
}}
use-clone-connection = ""{3}""
}}
}}
Expand Down Expand Up @@ -52,7 +55,10 @@ class = ""{0}""
provider-name = ""{2}""
parallelism = 1
max-row-by-row-size = 100
tables.journal {{ auto-init = true }}
tables.journal {{
auto-init = true
warn-on-auto-init-fail = false
}}
use-clone-connection = ""{3}""
}}
}}
Expand Down
7 changes: 7 additions & 0 deletions src/Akka.Persistence.Sql.Linq2Db/Config/JournalTableConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class JournalTableConfig
public bool AutoInitialize { get; protected set; }
public string MetadataTableName { get; protected set; }
public MetadataTableColumnNames MetadataColumnNames { get; protected set; }
public bool WarnOnAutoInitializeFail { get; }
public JournalTableConfig(Configuration.Config config)
{

Expand All @@ -25,14 +26,20 @@ public JournalTableConfig(Configuration.Config config)
"journal_metadata");
SchemaName = localcfg.GetString("schema-name", null);
AutoInitialize = localcfg.GetBoolean("auto-init", false);
WarnOnAutoInitializeFail =
localcfg.GetBoolean("warn-on-auto-init-fail", true);
}



protected bool Equals(JournalTableConfig other)
{
return Equals(ColumnNames, other.ColumnNames) &&
TableName == other.TableName &&
SchemaName == other.SchemaName &&
AutoInitialize == other.AutoInitialize &&
MetadataTableName == other.MetadataTableName &&
WarnOnAutoInitializeFail == other.WarnOnAutoInitializeFail &&
Equals(MetadataColumnNames, other.MetadataColumnNames);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ public SnapshotTableConfiguration(Configuration.Config config)
TableName = localcfg.GetString("table-name", "snapshot");
SchemaName = localcfg.GetString("schema-name", null);
AutoInitialize = localcfg.GetBoolean("auto-init", false);
WarnOnAutoInitializeFail =
localcfg.GetBoolean("warn-on-auto-init-fail", true);
}

public bool WarnOnAutoInitializeFail { get; protected set; }
public SnapshotTableColumnNames ColumnNames { get; protected set; }
public string TableName { get; protected set; }
public string SchemaName { get; protected set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ public void InitializeTables()
}
catch (Exception e)
{
_logger.Warning(e,$"Could not Create Journal Table {_journalConfig.TableConfig.TableName} as requested by config.");
if (_journalConfig.TableConfig.WarnOnAutoInitializeFail)
{
_logger.Warning(e,$"Could not Create Journal Table {_journalConfig.TableConfig.TableName} as requested by config.");
}

}

if (_journalConfig.DaoConfig.SqlCommonCompatibilityMode)
Expand All @@ -43,7 +47,10 @@ public void InitializeTables()
}
catch (Exception e)
{
_logger.Warning(e,$"Could not Create Journal Metadata Table {_journalConfig.TableConfig.TableName} as requested by config.");
if (_journalConfig.TableConfig.WarnOnAutoInitializeFail)
{
_logger.Warning(e,$"Could not Create Journal Metadata Table {_journalConfig.TableConfig.TableName} as requested by config.");
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ public void InitializeTables()
}
catch (Exception e)
{
_logger.Warning(e,$"Could not Create Snapshot Table {_snapshotConfig.TableConfig.TableName} as requested by config.");
if (_snapshotConfig.TableConfig.WarnOnAutoInitializeFail)
{
_logger.Warning(e,$"Could not Create Snapshot Table {_snapshotConfig.TableConfig.TableName} as requested by config.");
}
}
}
}
Expand Down
Loading

0 comments on commit e06499a

Please sign in to comment.