using System;
using System.Data;
using System.Data.SQLite;

namespace LJLib.DAL.SQL
{
    internal sealed class SqliteEngine : SqlEngine<SQLiteCommand>
    {
        protected override DateTime GetServerTimeInternal(SQLiteCommand cmd)
        {
            cmd.CommandText = "SELECT DATETIME()";
            cmd.CommandType = CommandType.Text;
            cmd.Parameters.Clear();
            return Convert.ToDateTime(cmd.ExecuteScalar());
        }

        protected override void AddWithValueInternal(SQLiteCommand cmd, string name, object value)
        {
            cmd.Parameters.AddWithValue(name, value);
        }
    }
}
