Ejemplo n.º 1
0
        public void Delete_Blob(FilePathsDBModel model)
        {
            using IDbConnection cnn = new SQLiteConnection(_connectionString);

            string query = "DELETE FROM Blobs " +
                           "WHERE FK_FilePathID = @FilePathID;";

            cnn.Execute(query, model);
            IncrementDatabaseRevision();
        }
Ejemplo n.º 2
0
        public void Insert_FilePath(FilePathsDBModel model)
        {
            using IDbConnection cnn = new SQLiteConnection(_connectionString);

            string query = "INSERT INTO FilePaths (FilePath, LastWriteTimeUtc, HashAlgorithm, FileHash) " +
                           "VALUES (@FilePath, @LastWriteTimeUtc, @HashAlgorithm, @FileHash);";

            cnn.Execute(query, model);
            IncrementDatabaseRevision();
        }
Ejemplo n.º 3
0
        public void Update_LastWriteTimeUtc(FilePathsDBModel model)
        {
            using IDbConnection cnn = new SQLiteConnection(_connectionString);

            string query = "UPDATE FilePaths " +
                           "SET LastWriteTimeUtc = @LastWriteTimeUtc " +
                           "WHERE FilePathID = @FilePathID;";

            cnn.Execute(query, model);
            IncrementDatabaseRevision();
        }
Ejemplo n.º 4
0
        public byte[] Select_Blob(FilePathsDBModel model)
        {
            using IDbConnection cnn = new SQLiteConnection(_connectionString);

            string query = "SELECT BlobData " +
                           "FROM Blobs " +
                           "WHERE FK_FilePathID = @FilePathID;";

            var output = cnn.QuerySingle <byte[]>(query, model);

            return(output);
        }
Ejemplo n.º 5
0
        public int Select_FilePathID(FilePathsDBModel model)
        {
            using IDbConnection cnn = new SQLiteConnection(_connectionString);

            string query = "SELECT FilePathID " +
                           "FROM FilePaths " +
                           "WHERE FilePath = @FilePath;";

            int output = cnn.ExecuteScalar <int>(query, model);

            return(output);
        }