using System;
using System.Collections.Generic;
using System.Text;
using Howest.SchemaDiscovery.DbObjects;
using System.Data.Common;
using System.Data.OleDb;
using System.Data;

namespace Howest.SchemaDiscovery.OleDb
{
	public class OleDbSchemaProvider : DbSchemaProvider
	{
		public override bool UseNamedParameters
		{
			get { return false; }
		}
		public override DbProviderFactory GetFactory()
		{
			return OleDbFactory.Instance;
		}

		protected override List<Table> GetTablesFromDb(DbConnection connection)
		{
			OleDbConnection conn = connection as OleDbConnection;
			if (conn == null)
				throw new ArgumentException("Connection object is null or not a valid OleDbConnection object", "connection");
			List<Table> tables = new List<Table>();
			string[] restrictions = new String[4] { null, null, null, "BASE TABLE" };
			DataTable tableSchema = conn.GetSchema("Tables", restrictions);
			return null;
		}

		protected override List<View> GetViewsFromDb(DbConnection connection)
		{
			throw new Exception("The method or operation is not implemented.");
		}

		protected override List<Procedure> GetProceduresFromDb(DbConnection connection)
		{
			throw new Exception("The method or operation is not implemented.");
		}

		protected override List<Parameter> GetProceduresResultSetFromDb(DbConnection connection, Procedure procedure)
		{
			throw new Exception("The method or operation is not implemented.");
		}

		protected override bool ValidateConnection(DbConnection connection)
		{
			return connection is OleDbConnection;
		}

		protected override List<Relation> GetRelationsFromDb(DbConnection connection)
		{
			throw new Exception("The method or operation is not implemented.");
		}

		protected override List<Parameter> GetSqlResultSetFromDb(DbConnection connection, string sql)
		{
			throw new Exception("The method or operation is not implemented.");
		}

		protected override void RunSqlStatementToDb(DbConnection connection, string sql)
		{
			throw new Exception("The method or operation is not implemented.");
		}

		/*protected override Column GetReferencedColumnFromDb(DbConnection connection, string schema, string table, string col)
		{
			throw new Exception("The method or operation is not implemented.");
		}*/
	}
}
