Beispiel #1
0
        public A4ARepository(IServiceServer server) : base(server)
        {
            var connectionString = SqlTableWithPrimaryKey.GetConnectionString(
                (string)server.GetConfigProperty("DataDirectory", server.BucketId),
                server.BucketId, "A4ARepository");

            underlying = new As.A4ACore.A4ARepository(connectionString);
        }
Beispiel #2
0
        public FuzzyMatcher(IServiceServer server) : base(server)
        {
            L.Trace(
                $"Opened server with bucket {server.BucketId} and data dir - {server.GetConfigProperty("DataDirectory",server.BucketId)}");

            connectionString = SqlTableWithPrimaryKey.GetConnectionString((string)server.GetConfigProperty("DataDirectory", server.BucketId),
                                                                          server.BucketId, "AmlWorker");
            L.Trace($"Initializing Sql - connectionString is {connectionString}");

            using (var connection = newConnection())
            {
                connection.Open();

                if (!SqlTableWithPrimaryKey.TableExists(connection, "FuzzyPhrase"))
                {
                    SqlTableWithPrimaryKey.ExecuteCommandLog(connection, FuzzyPhraseCreate);
                    SqlTableWithPrimaryKey.ExecuteCommandLog(connection, FuzzyTripleCreate);
                    SqlTableWithPrimaryKey.ExecuteCommandLog(connection, FuzzyPhraseToDocument);
                }
            }
        }
Beispiel #3
0
        public AmlRepository(IServiceServer server) : base(server)
        {
            _sqlTableWithPrimaryKey = new SqlTableWithPrimaryKey();

            connectionString = _sqlTableWithPrimaryKey.GetConnectionString(
                (string)server.GetConfigProperty("DataDirectory", server.BucketId),
                server.BucketId, "AmlWorker");

            L.Trace($"Initializing Sql - connectionString is {connectionString}");

            using (var connection = _sqlTableWithPrimaryKey.NewConnection(connectionString))
            {
                if (!_sqlTableWithPrimaryKey.TableExists(connection, partySql))
                {
                    _sqlTableWithPrimaryKey.CreateTable(connection, partySql);
                }

                if (!_sqlTableWithPrimaryKey.TableExists(connection, accountSql))
                {
                    _sqlTableWithPrimaryKey.CreateTable(connection, accountSql);
                }

                if (!_sqlTableWithPrimaryKey.TableExists(connection, "AccountParty"))
                {
                    new SqlTableSimpleLinkages().CreateManyToManyLinkagesTableWithForeignKeyConstraint(connection, "AccountParty",
                                                                                                       "AccountId", "PartyId", "Accounts", "Id");
                }

                if (!_sqlTableWithPrimaryKey.TableExists(connection, "PartyAccount"))
                {
                    new SqlTableSimpleLinkages().CreateManyToManyLinkagesTable(connection, "PartyAccount", "PartyId", "AccountId");
                }

                if (!_sqlTableWithPrimaryKey.TableExists(connection, transactionSql))
                {
                    _sqlTableWithPrimaryKey.CreateTable(connection, transactionSql);
                }
            }
        }