mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Let's be Mono friendly
This is a massive overhaul that replaces System.Data.SQLite with Mono.Data.Sqlite. This should make it more compatible with Linux and Mac and has no known downsides for Windows.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SQLite;
|
||||
using Mono.Data.Sqlite;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
@@ -72,12 +72,12 @@ namespace SabreTools
|
||||
if (_systems != "")
|
||||
{
|
||||
string query = "SELECT manufacturer, system FROM systems WHERE id in (" + _systems + ")";
|
||||
using (SQLiteConnection dbc = new SQLiteConnection(_connectionString))
|
||||
using (SqliteConnection dbc = new SqliteConnection(_connectionString))
|
||||
{
|
||||
dbc.Open();
|
||||
using (SQLiteCommand slc = new SQLiteCommand(query, dbc))
|
||||
using (SqliteCommand slc = new SqliteCommand(query, dbc))
|
||||
{
|
||||
using (SQLiteDataReader sldr = slc.ExecuteReader())
|
||||
using (SqliteDataReader sldr = slc.ExecuteReader())
|
||||
{
|
||||
// If there are no games for this combination, return nothing
|
||||
if (!sldr.HasRows)
|
||||
@@ -115,12 +115,12 @@ namespace SabreTools
|
||||
{
|
||||
string query = "SELECT name FROM sources WHERE id in (" + _sources + ")";
|
||||
|
||||
using (SQLiteConnection dbc = new SQLiteConnection(_connectionString))
|
||||
using (SqliteConnection dbc = new SqliteConnection(_connectionString))
|
||||
{
|
||||
dbc.Open();
|
||||
using (SQLiteCommand slc = new SQLiteCommand(query, dbc))
|
||||
using (SqliteCommand slc = new SqliteCommand(query, dbc))
|
||||
{
|
||||
using (SQLiteDataReader sldr = slc.ExecuteReader())
|
||||
using (SqliteDataReader sldr = slc.ExecuteReader())
|
||||
{
|
||||
// If there are no games for this combination, return nothing
|
||||
if (!sldr.HasRows)
|
||||
@@ -204,12 +204,12 @@ JOIN checksums
|
||||
(merged ? "checksums.size, checksums.crc, systems.id, sources.id, files.lastupdated DESC, checksums.md5, checksums.sha1"
|
||||
: "systems.id, sources.id, games.name, files.name");
|
||||
|
||||
using (SQLiteConnection dbc = new SQLiteConnection(_connectionString))
|
||||
using (SqliteConnection dbc = new SqliteConnection(_connectionString))
|
||||
{
|
||||
dbc.Open();
|
||||
using (SQLiteCommand slc = new SQLiteCommand(query, dbc))
|
||||
using (SqliteCommand slc = new SqliteCommand(query, dbc))
|
||||
{
|
||||
using (SQLiteDataReader sldr = slc.ExecuteReader())
|
||||
using (SqliteDataReader sldr = slc.ExecuteReader())
|
||||
{
|
||||
// If there are no games for this combination, return nothing
|
||||
if (!sldr.HasRows)
|
||||
|
||||
Reference in New Issue
Block a user