Example #1
0
        public PartsSearchHelper(IConnectionFactory factory, string tableName)
        {
            const int numberOfItems = 10;

            // insert
            _insert = new MultiplePersisterHelper <PersisterInsertPartsSearchHelper>(() => new PersisterInsertPartsSearchHelper(factory, $"INSERT OR IGNORE INTO {tableName} (docid, part) VALUES (@docid, @part)"), numberOfItems);
        }
Example #2
0
        public WordsHelper(IConnectionFactory factory, string tableName)
        {
            const int numberOfItems = 10;

            // create the word command.
            _insert = new MultiplePersisterHelper <PersisterInsertWordHelper>(() => new PersisterInsertWordHelper(factory, $"INSERT OR IGNORE INTO {tableName} (word) VALUES (@word)"), numberOfItems);

            // create the select
            _select = new MultiplePersisterHelper <PersisterSelectWordHelper>(() => new PersisterSelectWordHelper(factory, $"SELECT id FROM {tableName} WHERE word = @word"), numberOfItems);
        }
Example #3
0
        public PartsHelper(IConnectionFactory factory, string tableName)
        {
            const int numberOfItems = 10;

            // insert
            _insert = new MultiplePersisterHelper <PersisterInsertPartsHelper>(() => new PersisterInsertPartsHelper(factory, $"INSERT OR IGNORE INTO {tableName} (part) VALUES (@part)"), numberOfItems);

            // select
            _select = new MultiplePersisterHelper <PersisterSelectPartsHelper>(() => new PersisterSelectPartsHelper(factory, $"SELECT id FROM {tableName} WHERE part = @part"), numberOfItems);
        }
Example #4
0
        public FilesWordsHelper(IConnectionFactory factory, string tableName)
        {
            const int numberOfItems = 10;

            // check if a file exists.
            _exists = new MultiplePersisterHelper <PersisterExistsFilesWordsHelper>(() => new PersisterExistsFilesWordsHelper(factory, $"SELECT 1 FROM {tableName} where wordid=@wordid AND fileid=@fileid"), numberOfItems);

            // delete
            _delete = new MultiplePersisterHelper <PersisterDeleteFilesWordsHelper>(() => new PersisterDeleteFilesWordsHelper(factory, $"DELETE FROM {tableName} WHERE fileid=@fileid"), numberOfItems);

            // insert
            _insert = new MultiplePersisterHelper <PersisterInsertFilesWordsHelper>(() => new PersisterInsertFilesWordsHelper(factory, $"INSERT OR IGNORE INTO {tableName} (wordid, fileid) VALUES (@wordid, @fileid)"), numberOfItems);
        }
        public WordsPartsHelper(IConnectionFactory factory, string tableName)
        {
            const int numberOfItems = 10;

            // the insert command.
            _insert = new MultiplePersisterHelper <PersisterInsertWordPartsHelper>(() => new PersisterInsertWordPartsHelper(factory, $"INSERT OR IGNORE INTO {tableName} (wordid, partid) VALUES (@wordid, @partid)"), numberOfItems);

            // exists?
            _exists = new MultiplePersisterHelper <PersisterExistsWordPartsHelper>(() => new PersisterExistsWordPartsHelper(factory, $"SELECT 1 FROM {tableName} WHERE wordid=@wordid and partid=@partid"), numberOfItems);

            // select by word id.
            _select = new MultiplePersisterHelper <PersisterSelectWordPartsHelper>(() => new PersisterSelectWordPartsHelper(factory, $"SELECT partid FROM {tableName} WHERE wordid = @wordid"), numberOfItems);

            // delete by word/part id.
            _delete = new MultiplePersisterHelper <PersisterDeleteWordPartsHelper>(() => new PersisterDeleteWordPartsHelper(factory, $"DELETE FROM {tableName} WHERE wordid=@wordid AND partid=@partid"), numberOfItems);
        }