public virtual void UpdateUnfilteredAggregates() { HyenaSqliteCommand count_command = new HyenaSqliteCommand(String.Format( "SELECT COUNT(*), SUM(CoreTracks.FileSize), SUM(CoreTracks.Duration) {0}", UnfilteredQuery )); using (HyenaDataReader reader = new HyenaDataReader(connection.Query(count_command))) { count = reader.Get <long> (0); filesize = reader.Get <long> (1); duration = reader.Get <TimeSpan> (2); } }
public virtual void UpdateUnfilteredAggregates() { HyenaSqliteCommand count_command = new HyenaSqliteCommand(String.Format( "SELECT COUNT(*), SUM({0}), SUM({1}) {2}", BansheeQuery.FileSizeField.Column, BansheeQuery.DurationField.Column, UnfilteredQuery )); using (HyenaDataReader reader = new HyenaDataReader(connection.Query(count_command))) { count = reader.Get <long> (0); filesize = reader.Get <long> (1); duration = reader.Get <TimeSpan> (2); } }
private void iSet(string key, string type, string val) { try { int cnt = _con.Query <int> (_sql_check, key); //int cnt=(int) Convert.ChangeType (rdr[0],typeof(int)); if (cnt == 0) { _con.Execute(_sql_insert, key, type, val); } else { _con.Execute(_sql_update, type, val, key); } } catch (System.Exception ex) { Hyena.Log.Information(ex.ToString()); } }
public CS_TrackInfoDb(BansheeDbConnection con) { _con = con; _sql_check = new HyenaSqliteCommand("SELECT COUNT(*) FROM cuesheet_info WHERE key=?"); _sql_get = new HyenaSqliteCommand("SELECT type,value FROM cuesheet_info WHERE key=?"); _sql_insert = new HyenaSqliteCommand("INSERT INTO cuesheet_info VALUES(?,?,?)"); _sql_update = new HyenaSqliteCommand("UPDATE cuesheet_info SET type=?, value=? WHERE key=?"); _sql_key_begin = new HyenaSqliteCommand("SELECT key FROM cuesheet_info WHERE key LIKE ?"); try { if (!_con.TableExists("cuesheet_info")) { _con.Query("CREATE TABLE cuesheet_info(key varchar,type varchar,value varchar)"); _con.Query("CREATE INDEX cuesheet_idx1 ON cuesheet_info(key)"); } } catch (System.Exception ex) { Hyena.Log.Information(ex.ToString()); } }
private IDataReader Get(string namespce, string key) { return(connection.Query(select_value_command, Banshee.Configuration.MemoryConfigurationClient.MakeKey(namespce, key))); }
private void UpdateUnfilteredAggregates() { using (var reader = new HyenaDataReader(connection.Query(UnfilteredCountCommand))) { UnfilteredCount = reader.Get <int> (0); } }