From lluis at mono-cvs.ximian.com Mon Aug 1 15:10:24 2005 From: lluis at mono-cvs.ximian.com (Lluis Sanchez ) Date: Mon, 1 Aug 2005 15:10:24 -0400 (EDT) Subject: [Monodevelop-patches-list] r2700 - trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Search Message-ID: <20050801191024.AB7209472C@mono-cvs.ximian.com> Author: lluis Date: 2005-08-01 15:10:24 -0400 (Mon, 01 Aug 2005) New Revision: 2700 Removed: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Search/ISearchableDocument.cs Log: Remove file that should not have been added. Deleted: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Search/ISearchableDocument.cs =================================================================== --- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Search/ISearchableDocument.cs 2005-07-30 22:19:58 UTC (rev 2699) +++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Search/ISearchableDocument.cs 2005-08-01 19:10:24 UTC (rev 2700) @@ -1,10 +0,0 @@ - -using System; - -namespace MonoDevelop.TextEditor.Document -{ - public interface ISearchableDocument - { - - } -} From chergert at mono-cvs.ximian.com Tue Aug 2 16:35:00 2005 From: chergert at mono-cvs.ximian.com (Christian Hergert ) Date: Tue, 2 Aug 2005 16:35:00 -0400 (EDT) Subject: [Monodevelop-patches-list] r2701 - in trunk/MonoDevelop: . Extras/MonoQuery Extras/MonoQuery/Mono.Data.Sql Extras/MonoQuery/Mono.Data.Sql/Providers Extras/MonoQuery/Mono.Data.Sql/Schema Extras/MonoQuery/MonoQuery Extras/MonoQuery/MonoQuery/Commands Extras/MonoQuery/MonoQuery/Gui Extras/MonoQuery/MonoQuery/Gui/NodeBuilders Extras/MonoQuery/tests build/data/resources/icons po Message-ID: <20050802203500.D62F79472C@mono-cvs.ximian.com> Author: chergert Date: 2005-08-02 16:35:00 -0400 (Tue, 02 Aug 2005) New Revision: 2701 Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql.mds trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/AssemblyInfo.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Makefile.am trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Mono.Data.Sql.mdp trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/DbProviderBase.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/MySqlDbProvider.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/NpgsqlDbProvider.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/OracleDbProvider.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/SqlDbProvider.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/SqliteDbProvider.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/AbstractSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/AggregateSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/CheckConstraintSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ColumnSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ConstraintSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/DataTypeSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ForeignKeyConstraintSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/GroupSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ISchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/IndexConstraintSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/LanguageSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/OperatorSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ParameterSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/PrimaryKeyConstraintSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/PrivilegeSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ProcedureSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/RoleSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/RuleSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/SchemaSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/SequenceSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/TableSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/TriggerSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/UniqueConstraintSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/UserSchema.cs trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ViewSchema.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/ trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/AssemblyInfo.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Commands/ trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Commands/Commands.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/ trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/ConnectionDialog.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/DataGridView.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/DatabasePad.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/DbProviderCollection.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/FakeNodes.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/ trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/AggregatesNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/ColumnNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/ColumnsNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/ConstraintNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/ConstraintsNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/DatabaseNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/GroupsNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/LanguagesNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/OperatorsNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/ParametersNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/ProcedureNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/ProceduresNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/ProviderCollectionNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/RolesNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/RulesNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/SequencesNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/TableNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/TablesNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/TriggersNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/TypesNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/UsersNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/ViewNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/NodeBuilders/ViewsNodeBuilder.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Gui/SqlDefinitionPad.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Makefile trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Makefile.am trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/Makefile.in trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/MonoQuery.addin.xml trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/MonoQuery.mdp trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/MonoQuery.mds trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/MonoQueryService.cs trunk/MonoDevelop/Extras/MonoQuery/MonoQuery/monoquery.glade trunk/MonoDevelop/Extras/MonoQuery/tests/ trunk/MonoDevelop/Extras/MonoQuery/tests/CreateProviderTests.cs trunk/MonoDevelop/Extras/MonoQuery/tests/Mono.Data.Sql.Tests.mdp trunk/MonoDevelop/Extras/MonoQuery/tests/NpgsqlTablesTest.cs trunk/MonoDevelop/Extras/MonoQuery/tests/pgsql.sql trunk/MonoDevelop/build/data/resources/icons/MonoQuery.Column trunk/MonoDevelop/build/data/resources/icons/MonoQuery.ColumnFK trunk/MonoDevelop/build/data/resources/icons/MonoQuery.ColumnPK trunk/MonoDevelop/build/data/resources/icons/MonoQuery.DateTime trunk/MonoDevelop/build/data/resources/icons/MonoQuery.User Removed: trunk/MonoDevelop/Extras/MonoQuery/AssemblyInfo.cs trunk/MonoDevelop/Extras/MonoQuery/Codons/ trunk/MonoDevelop/Extras/MonoQuery/Collection/ trunk/MonoDevelop/Extras/MonoQuery/Commands/ trunk/MonoDevelop/Extras/MonoQuery/Connection/ trunk/MonoDevelop/Extras/MonoQuery/Exceptions/ trunk/MonoDevelop/Extras/MonoQuery/Gui/ trunk/MonoDevelop/Extras/MonoQuery/MonoQuery.addin.xml.in trunk/MonoDevelop/Extras/MonoQuery/MonoQuery.cmbx trunk/MonoDevelop/Extras/MonoQuery/MonoQuery.mdsx trunk/MonoDevelop/Extras/MonoQuery/MonoQuery.prjx trunk/MonoDevelop/Extras/MonoQuery/MonoQueryView.cs trunk/MonoDevelop/Extras/MonoQuery/SchemaClass/ trunk/MonoDevelop/Extras/MonoQuery/Services/ Modified: trunk/MonoDevelop/ChangeLog trunk/MonoDevelop/Extras/MonoQuery/ trunk/MonoDevelop/Extras/MonoQuery/ChangeLog trunk/MonoDevelop/Extras/MonoQuery/Makefile.am trunk/MonoDevelop/build/data/resources/icons/Makefile.am trunk/MonoDevelop/build/data/resources/icons/MonoQuery.Database trunk/MonoDevelop/build/data/resources/icons/MonoQuery.Table trunk/MonoDevelop/build/data/resources/icons/MonoQuery.Tables trunk/MonoDevelop/configure.in trunk/MonoDevelop/po/POTFILES.in Log: Large commit. See ChangeLog and Extras/MonoQuery/ChangeLog Modified: trunk/MonoDevelop/ChangeLog =================================================================== --- trunk/MonoDevelop/ChangeLog 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/ChangeLog 2005-08-02 20:35:00 UTC (rev 2701) @@ -1,3 +1,8 @@ +2005-08-02 Chrstian Hergert + + * configure.in: Remove monoquery autoconf options. We no longer need them. + * build/data/resources/icons: Added some icons donated from MySQL. + 2005-07-21 Peter Johanson * configure.in: Bump boo dep as needed by recent completion changes. Property changes on: trunk/MonoDevelop/Extras/MonoQuery ___________________________________________________________________ Name: svn:ignore - Makefile Makefile.in MonoQuery.dll MonoQuery.addin.xml + Makefile Makefile.in bin Deleted: trunk/MonoDevelop/Extras/MonoQuery/AssemblyInfo.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/AssemblyInfo.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/AssemblyInfo.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -1,49 +0,0 @@ -// MonoQuery.MonoQuery.dll - Addin for #Develop for database design -// Copyright (C) 2003 Denis ERCHOFF -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following -// attributes. -// -// change them to the information which is associated with the assembly -// you compile. - -[assembly: AssemblyTitle("MonoQuery")] -[assembly: AssemblyDescription("Database addin for MonoDevelop")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("#Develop, MonoDevelop")] -[assembly: AssemblyProduct("Mono Query")] -[assembly: AssemblyCopyright("Copyright (C) 2003 Denis ERCHOFF, 2004 Christian Hergert")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// The assembly version has following format : -// -// Major.Minor.Build.Revision -// -// You can specify all values by your own or you can build default build and revision -// numbers with the '*' character (the default): - -[assembly: AssemblyVersion("0.4.0.*")] - -// The following attributes specify the key for the sign of your assembly. See the -// .NET Framework documentation for more information about signing. -// This is not required, if you don't want signing let these attributes like they're. -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] Modified: trunk/MonoDevelop/Extras/MonoQuery/ChangeLog =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/ChangeLog 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/ChangeLog 2005-08-02 20:35:00 UTC (rev 2701) @@ -1,3 +1,102 @@ +2005-08-02 Christian Hergert + + * MonoQuery.prjx: deleted + * MonoQuery.addin.xml.in: removed + * Exceptions: removed + * Services: removed + * Gui: removed + * Codons: removed + * SchemaClass: removed + * MonoQuery.cmbx: removed + * Collection: removed + * MonoQueryView.cs: removed + * MonoQuery/AssemblyInfo.cs: part of monoquery2 + * MonoQuery/MonoQuery.mds: + * MonoQuery/Commands: + * MonoQuery/Commands/Commands.cs: + * MonoQuery/Makefile.in: + * MonoQuery/MonoQueryService.cs: + * MonoQuery/Gui/NodeBuilders/UsersNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/ParametersNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/DatabaseNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/TypesNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/LanguagesNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/ProviderCollectionNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/ConstraintsNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/AggregatesNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/TablesNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/ViewNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/ProceduresNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/OperatorsNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/GroupsNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/ColumnsNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/RolesNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/ConstraintNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/TriggersNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/TableNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/ProcedureNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/RulesNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/SequencesNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/ColumnNodeBuilder.cs: + * MonoQuery/Gui/NodeBuilders/ViewsNodeBuilder.cs: + * MonoQuery/Gui/DbProviderCollection.cs: + * MonoQuery/Gui/SqlDefinitionPad.cs: + * MonoQuery/Gui/ConnectionDialog.cs: + * MonoQuery/Gui/FakeNodes.cs: + * MonoQuery/Gui/DatabasePad.cs: + * MonoQuery/Gui/DataGridView.cs: + * MonoQuery/monoquery.glade: + * MonoQuery/Makefile.am: + * MonoQuery/MonoQuery.addin.xml: + * MonoQuery/Makefile: + * MonoQuery/MonoQuery.mdp: + * AssemblyInfo.cs: removed + * Mono.Data.Sql.mds: removed + * Commands: removed + * tests/NpgsqlTablesTest.cs: start of tests for monoquery2. these dont + really do anything at the moment + * tests/pgsql.sql + * tests/CreateProviderTests.cs + * tests/Mono.Data.Sql.Tests.mdp + * MonoQuery.mdsx: removed + * Makefile.am: updated + * Mono.Data.Sql/AssemblyInfo.cs: core to monoquery2 + * Mono.Data.Sql/Schema: + * Mono.Data.Sql/Schema/OperatorSchema.cs: + * Mono.Data.Sql/Schema/GroupSchema.cs: + * Mono.Data.Sql/Schema/ColumnSchema.cs: + * Mono.Data.Sql/Schema/SchemaSchema.cs: + * Mono.Data.Sql/Schema/RoleSchema.cs: + * Mono.Data.Sql/Schema/PrimaryKeyConstraintSchema.cs: + * Mono.Data.Sql/Schema/AbstractSchema.cs: + * Mono.Data.Sql/Schema/TriggerSchema.cs: + * Mono.Data.Sql/Schema/RuleSchema.cs: + * Mono.Data.Sql/Schema/ForeignKeyConstraintSchema.cs: + * Mono.Data.Sql/Schema/SequenceSchema.cs: + * Mono.Data.Sql/Schema/ViewSchema.cs: + * Mono.Data.Sql/Schema/UniqueConstraintSchema.cs: + * Mono.Data.Sql/Schema/DataTypeSchema.cs: + * Mono.Data.Sql/Schema/IndexConstraintSchema.cs: + * Mono.Data.Sql/Schema/UserSchema.cs: + * Mono.Data.Sql/Schema/ParameterSchema.cs: + * Mono.Data.Sql/Schema/CheckConstraintSchema.cs: + * Mono.Data.Sql/Schema/LanguageSchema.cs: + * Mono.Data.Sql/Schema/ConstraintSchema.cs: + * Mono.Data.Sql/Schema/PrivilegeSchema.cs: + * Mono.Data.Sql/Schema/AggregateSchema.cs: + * Mono.Data.Sql/Schema/TableSchema.cs: + * Mono.Data.Sql/Schema/ISchema.cs: + * Mono.Data.Sql/Schema/ProcedureSchema.cs: + * Mono.Data.Sql/Makefile.am: + * Mono.Data.Sql/Providers: + * Mono.Data.Sql/Providers/DbProviderBase.cs: + * Mono.Data.Sql/Providers/SqlDbProvider.cs: + * Mono.Data.Sql/Providers/SqliteDbProvider.cs: + * Mono.Data.Sql/Providers/NpgsqlDbProvider.cs: + * Mono.Data.Sql/Providers/MySqlDbProvider.cs: + * Mono.Data.Sql/Providers/OracleDbProvider.cs: + * Mono.Data.Sql/Mono.Data.Sql.mdp: + 2005-07-13 Lluis Sanchez Gual * MonoQueryView.cs: Modified: trunk/MonoDevelop/Extras/MonoQuery/Makefile.am =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Makefile.am 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Makefile.am 2005-08-02 20:35:00 UTC (rev 2701) @@ -1,80 +1,3 @@ -FILES = \ -AssemblyInfo.cs \ -Codons/MonoQueryConnectionCodon.cs \ -Collection/MonoQuerySchemaClassCollection.cs \ -Collection/MonoQueryStringDictionary.cs \ -Collection/MonoQueryListDictionary.cs \ -Collection/MonoQueryParameterCollection.cs \ -Collection/ConnectionProviderDescriptor.cs \ -Commands/Abstract/AbstractMonoQueryCommand.cs \ -Commands/MonoQueryCommands.cs \ -Connection/Abstract/AbstractMonoQueryConnectionWrapper.cs \ -Connection/Interface/IConnection.cs \ -Connection/Npgsql/NpgsqlConnectionWrapper.cs \ -Connection/Mysql/MysqlConnectionWrapper.cs \ -Exceptions/Abstract/MonoQueryAbstractException.cs \ -Exceptions/ConnectionStringException.cs \ -Exceptions/ExecuteProcedureException.cs \ -Exceptions/ExecuteSQLException.cs \ -Exceptions/OpenConnectionException.cs \ -SchemaClass/Abstract/AbstractMonoQuerySchemaClass.cs \ -SchemaClass/Interface/ISchemaClass.cs \ -SchemaClass/MonoQuerySchemaClass.cs \ -MonoQueryView.cs \ -Gui/Abstract/AbstractMonoQueryNode.cs \ -Gui/DataView/SQLParameterInput.cs \ -Gui/DataView/MonoQueryDataView.cs \ -Gui/Interface/IMonoQueryNode.cs \ -Gui/MonoQueryTree/MonoQueryNodesRoot.cs \ -Gui/MonoQueryTree/MonoQueryTree.cs \ -Gui/MonoQueryTree/MonoQueryDataNodes.cs \ -Gui/MonoQueryPanel.cs \ -Gui/Forms/CreateConnectionDruid.cs \ -Gui/SqlQueryView/SqlQueryView.cs \ -Services/MonoQueryService.cs -if ENABLE_MONOQUERY_SQLITE -SQLITE_FILES=Connection/Sqlite/SqliteConnectionWrapper.cs -else -SQLITE_FILES= -endif - - -build_sources = $(addprefix $(srcdir)/, $(FILES)) \ - $(addprefix $(srcdir)/, $(SQLITE_FILES)) - -REFS = /r:$(top_builddir)/build/bin/MonoDevelop.Core.dll \ - /r:$(top_builddir)/build/bin/MonoDevelop.Base.dll \ - /r:$(top_builddir)/build/bin/MonoDevelop.Gui.Widgets.dll \ - /r:Npgsql.dll \ - /r:System.Data.dll \ - /r:ByteFX.Data.dll \ - /r:Mono.Data.SqliteClient \ - $(GTK_SHARP_LIBS) \ - $(GLADE_SHARP_LIBS) \ - $(GCONF_SHARP_LIBS) \ - $(GTKSOURCEVIEW_SHARP_LIBS) - -ADDIN = MonoQuery.addin.xml - -ADDIN_BUILD = $(top_builddir)/build/AddIns/MonoQuery - -DLL = $(ADDIN_BUILD)/MonoQuery.dll - -all: $(ADDIN_BUILD)/$(ADDIN) $(DLL) - -$(ADDIN_BUILD)/$(ADDIN): $(srcdir)/$(ADDIN) - mkdir -p $(ADDIN_BUILD) - cp $(srcdir)/$(ADDIN) $(ADDIN_BUILD)/$(ADDIN) - -$(DLL): $(build_sources) $(srcdir)/$(GLADEFILE) - mkdir -p $(ADDIN_BUILD) - $(CSC) $(CSC_FLAGS) -target:library -out:$@ $(build_sources) $(REFS) - -CLEANFILES = $(DLL) $(DLL).mdb $(ADDIN_BUILD)/$(ADDIN) - -EXTRA_DIST = $(FILES) $(ADDIN) $(SQLITE_FILES) - -monoquerydir = $(MD_ADDIN_DIR)/MonoQuery -monoquery_DATA = $(DLL) $(ADDIN_BUILD)/$(ADDIN) - +SUBDIRS = Mono.Data.Sql MonoQuery +#SUBDIRS = Mono.Data.Sql MonoQuery tests Property changes on: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql ___________________________________________________________________ Name: svn:ignore + Makefile Makefile.in *.pidb Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/AssemblyInfo.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/AssemblyInfo.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/AssemblyInfo.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,62 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the "project output directory". The location of the project output +// directory is dependent on whether you are working with a local or web project. +// For local projects, the project output directory is defined as +// \obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// For web projects, the project output directory is defined as +// %HOMEPATH%\VSWebCache\\\obj\. +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Makefile.am =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Makefile.am 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Makefile.am 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,59 @@ +FILES = \ +Schema/IndexConstraintSchema.cs \ +Schema/OperatorSchema.cs \ +Schema/GroupSchema.cs \ +Schema/ColumnSchema.cs \ +Schema/SchemaSchema.cs \ +Schema/RoleSchema.cs \ +Schema/ISchema.cs \ +Schema/PrimaryKeyConstraintSchema.cs \ +Schema/AbstractSchema.cs \ +Schema/TriggerSchema.cs \ +Schema/RuleSchema.cs \ +Schema/ForeignKeyConstraintSchema.cs \ +Schema/SequenceSchema.cs \ +Schema/ViewSchema.cs \ +Schema/DataTypeSchema.cs \ +Schema/UniqueConstraintSchema.cs \ +Schema/UserSchema.cs \ +Schema/ParameterSchema.cs \ +Schema/CheckConstraintSchema.cs \ +Schema/LanguageSchema.cs \ +Schema/ConstraintSchema.cs \ +Schema/PrivilegeSchema.cs \ +Schema/AggregateSchema.cs \ +Schema/TableSchema.cs \ +Schema/ProcedureSchema.cs \ +Providers/MySqlDbProvider.cs \ +Providers/DbProviderBase.cs \ +Providers/NpgsqlDbProvider.cs \ +Providers/SqliteDbProvider.cs \ +Providers/OracleDbProvider.cs \ +Providers/SqlDbProvider.cs \ +AssemblyInfo.cs + +build_sources = $(addprefix $(srcdir)/, $(FILES)) + +REFS = \ +-r:System.Data \ +-r:Npgsql \ +-r:ByteFX.Data \ +-r:Mono.Data.SqliteClient \ +-r:System.Data.OracleClient + +ADDIN_BUILD = $(top_builddir)/build/AddIns/MonoQuery + +DLL = $(ADDIN_BUILD)/Mono.Data.Sql.dll + +all: $(DLL) + +$(DLL): + mkdir -p $(ADDIN_BUILD) + $(CSC) $(SCS_FLAGS) -target:library -out:$@ $(build_sources) $(REFS) + +CLEANFILES = $(DLL) $(DLL).mdb + +EXTRA_DIST = $(FILES) + +monoquerydir = $(MD_ADDIN_DIR)/MonoQuery +monoquery_DATA = $(DLL) Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Mono.Data.Sql.mdp =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Mono.Data.Sql.mdp 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Mono.Data.Sql.mdp 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/DbProviderBase.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/DbProviderBase.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/DbProviderBase.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,347 @@ +// +// DbProviderBase.cs +// +// Authors: +// Christian Hergert +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.Collections; +using System.Data; +using System.Threading; + +namespace Mono.Data.Sql +{ + public delegate void DbProviderChangedEventHandler (object sender, DbProviderChangedArgs args); + public delegate void SQLCallback (object sender, object Results); + + public class DbProviderChangedArgs : EventArgs + { + public DbProviderBase Provider = null; + + public DbProviderChangedArgs (DbProviderBase provider) + { + Provider = provider; + } + } + + [Serializable] + public abstract class DbProviderBase + { + public event DbProviderChangedEventHandler NameChanged; + public event DbProviderChangedEventHandler StateChanged; + public event DbProviderChangedEventHandler Refreshed; + + protected string name = String.Empty; + + #region // Threading objects + Object ThreadSync = new Object (); + SQLCallback ThreadedSQLCallback; + TableSchema ThreadedTableSchema; + ViewSchema ThreadedViewSchema; + ProcedureSchema ThreadedProcedureSchema; + String ThreadedSQLText = String.Empty; + #endregion // End of Threading objects + + public DbProviderBase () + { + } + + public virtual string ProviderName { + get { + return "Unknown Provider"; + } + } + + public virtual string Name { + get { + return name; + } + set { + name = value; + if (NameChanged != null) + NameChanged (this, new DbProviderChangedArgs (this)); + } + } + + public virtual IDbConnection Connection { + get { + return (IDbConnection) null; + } + } + + public virtual string ConnectionString { + get { + throw new NotImplementedException (); + } + set { + throw new NotImplementedException (); + } + } + + public virtual bool IsConnectionStringWrong { + get { + return true; + } + } + + public virtual bool IsOpen { + get { + return false; + } + } + + public virtual bool Open () + { + return IsOpen; + } + + public virtual void Close () + { + throw new NotImplementedException (); + } + + public virtual void Refresh () + { + if (Refreshed != null) + Refreshed (this, new DbProviderChangedArgs (this)); + } + + public virtual bool SupportsSchemaType (Type type) + { + return false; + } + + public virtual void ExecuteSQL (string SQLText, SQLCallback Callback) + { + lock (ThreadSync) { + ThreadedSQLCallback = Callback; + ThreadedSQLText = SQLText; + Thread eThread = new Thread (new ThreadStart (ExecuteSQLThreadStart)); + eThread.Start (); + } + } + + public virtual DataTable ExecuteSQL (string SQLText) + { + throw new NotImplementedException (); + } + + public virtual void GetTables (SQLCallback Callback) + { + Thread eThread = null; + lock (ThreadSync) { + ThreadedSQLCallback = Callback; + eThread = new Thread (new ThreadStart (GetTablesThreadStart)); + eThread.Start (); + } + } + + public virtual TableSchema[] GetTables () + { + throw new NotImplementedException (); + } + + public virtual void GetTableColumns (SQLCallback Callback, TableSchema schema) + { + Thread eThread = null; + lock (ThreadSync) { + ThreadedSQLCallback = Callback; + ThreadedTableSchema = schema; + eThread = new Thread (new ThreadStart (GetTableColumnsThreadStart)); + eThread.Start (); + } + } + + public virtual ColumnSchema[] GetTableColumns (TableSchema schema) + { + throw new NotImplementedException (); + } + + public virtual void GetTableConstraints (SQLCallback Callback, TableSchema schema) + { + Thread eThread = null; + lock (ThreadSync) { + ThreadedSQLCallback = Callback; + ThreadedTableSchema = schema; + eThread = new Thread (new ThreadStart (GetTableConstraintsThreadStart)); + eThread.Start (); + } + } + + public virtual ConstraintSchema[] GetTableConstraints (TableSchema schema) + { + throw new NotImplementedException (); + } + + public virtual void GetViews (SQLCallback Callback) + { + Thread eThread = null; + lock (ThreadSync) { + ThreadedSQLCallback = Callback; + eThread = new Thread (new ThreadStart (GetViewsThreadStart)); + eThread.Start (); + } + } + + public virtual ViewSchema[] GetViews () + { + throw new NotImplementedException (); + } + + public virtual void GetViewColumns (SQLCallback Callback, ViewSchema schema) + { + Thread eThread = null; + lock (ThreadSync) { + ThreadedSQLCallback = Callback; + ThreadedViewSchema = schema; + eThread = new Thread (new ThreadStart (GetViewColumnsThreadStart)); + eThread.Start (); + } + } + + public virtual ColumnSchema[] GetViewColumns (ViewSchema schema) + { + throw new NotImplementedException (); + } + + public virtual void GetProcedures (SQLCallback Callback) + { + Thread eThread = null; + lock (ThreadSync) { + ThreadedSQLCallback = Callback; + eThread = new Thread (new ThreadStart (GetProceduresThreadStart)); + eThread.Start (); + } + } + + public virtual ProcedureSchema[] GetProcedures () + { + throw new NotImplementedException (); + } + + public virtual void GetProcedureColumns (SQLCallback Callback, ProcedureSchema schema) + { + Thread eThread = null; + lock (ThreadSync) { + ThreadedSQLCallback = Callback; + ThreadedProcedureSchema = schema; + eThread = new Thread (new ThreadStart ( + GetProcedureColumnsThreadStart)); + eThread.Start (); + } + } + + public virtual ColumnSchema[] GetProcedureColumns (ProcedureSchema schema) + { + throw new NotImplementedException (); + } + + public virtual void GetUsers (SQLCallback Callback) + { + Thread eThread = null; + lock (ThreadSync) { + ThreadedSQLCallback = Callback; + eThread = new Thread (new ThreadStart (GetUsersThreadStart)); + eThread.Start (); + } + } + + public virtual UserSchema[] GetUsers () + { + throw new NotImplementedException (); + } + + protected virtual void OnOpen () + { + if (StateChanged != null) + StateChanged (this, new DbProviderChangedArgs (this)); + } + + protected virtual void OnClose () + { + if (StateChanged != null) + StateChanged (this, new DbProviderChangedArgs (this)); + } + + protected virtual void ExecuteSQLThreadStart () + { + string SQLText = ThreadedSQLText; + SQLCallback Callback = ThreadedSQLCallback; + Callback (this, ExecuteSQL (SQLText)); + } + + protected virtual void GetTablesThreadStart () + { + SQLCallback Callback = ThreadedSQLCallback; + Callback (this, GetTables ()); + } + + protected virtual void GetTableColumnsThreadStart () + { + SQLCallback Callback = ThreadedSQLCallback; + TableSchema Table = ThreadedTableSchema; + Callback (this, GetTableColumns (Table)); + } + + protected virtual void GetTableConstraintsThreadStart () + { + SQLCallback Callback = ThreadedSQLCallback; + TableSchema Table = ThreadedTableSchema; + Callback (this, GetTableConstraints (Table)); + } + + protected virtual void GetViewsThreadStart () + { + SQLCallback Callback = ThreadedSQLCallback; + Callback (this, GetViews ()); + } + + protected virtual void GetViewColumnsThreadStart () + { + SQLCallback Callback = ThreadedSQLCallback; + ViewSchema view = ThreadedViewSchema; + Callback (this, GetViewColumns (view)); + } + + protected virtual void GetProceduresThreadStart () + { + SQLCallback Callback = ThreadedSQLCallback; + Callback (this, GetProcedures ()); + } + + protected virtual void GetProcedureColumnsThreadStart () + { + SQLCallback Callback = ThreadedSQLCallback; + ProcedureSchema schema = ThreadedProcedureSchema; + Callback (this, GetProcedureColumns (schema)); + } + + protected virtual void GetUsersThreadStart () + { + SQLCallback Callback = ThreadedSQLCallback; + Callback (this, GetUsers ()); + } + } +} \ No newline at end of file Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/MySqlDbProvider.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/MySqlDbProvider.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/MySqlDbProvider.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,277 @@ +// +// Providers/MySqlDbProvider.cs +// +// Authors: +// Christian Hergert +// +// Copyright (c) 2005 Christian Hergert +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.Collections; +using System.Data; + +using ByteFX.Data.MySqlClient; + +namespace Mono.Data.Sql +{ + [Serializable] + public class MySqlDbProvider : DbProviderBase + { + protected MySqlConnection connection = null; + protected MySqlDataAdapter adapter = new MySqlDataAdapter (); + protected bool isConnectionStringWrong = false; + + public override string ProviderName { + get { + return "MySQL Database (Incomplete)"; + } + } + + public override IDbConnection Connection { + get { + if (connection == null) + connection = new MySqlConnection (); + + return (IDbConnection) connection; + } + } + + public override string ConnectionString { + get { + return Connection.ConnectionString; + } + set { + if (IsOpen) + Close (); + + Connection.ConnectionString = value; + isConnectionStringWrong = false; + } + } + + public override bool IsOpen { + get { + return Connection.State == ConnectionState.Open; + } + } + + public override bool IsConnectionStringWrong { + get { + return isConnectionStringWrong; + } + } + + public override bool Open () + { + try { + Connection.Open (); + OnOpen (); + } catch (Exception e) { + isConnectionStringWrong = true; + } + + return IsOpen; + } + + public override void Close () + { + Connection.Close (); + OnClose (); + } + + public override bool SupportsSchemaType(Type type) + { + // FIXME: Need to check what mysql actually supports. + if (type == typeof(TableSchema)) + return true; + else if (type == typeof(ViewSchema)) + return true; + else if (type == typeof(ProcedureSchema)) + return true; + else if (type == typeof(AggregateSchema)) + return true; + else if (type == typeof(GroupSchema)) + return true; + else if (type == typeof(UserSchema)) + return true; + else if (type == typeof(LanguageSchema)) + return true; + else if (type == typeof(OperatorSchema)) + return true; + else if (type == typeof(RoleSchema)) + return true; + else if (type == typeof(SequenceSchema)) + return true; + else if (type == typeof(DataTypeSchema)) + return true; + else if (type == typeof(TriggerSchema)) + return true; + else if (type == typeof(RuleSchema)) + return true; + else + return false; + } + + public override DataTable ExecuteSQL (string SQLText) + { + MySqlCommand command = new MySqlCommand (); + command.Connection = Connection; + command.CommandText = SQLText; + + DataSet resultSet = null; + + lock (adapter) { + adapter.SelectCommand = command; + adapter.Fill (resultSet); + } + + return resultSet.Tables[0]; + } + + public override TableSchema[] GetTables () + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection"); + + ArrayList collection = new ArrayList (); + + MySqlCommand command = new MySqlCommand (); + command.Connection = Connection; + command.CommandText = + ""; + MySqlDataReader r = command.ExecuteReader (); + + while (r.Read ()) { + TableSchema table = new TableSchema (); + table.Provider = this; + + // TODO: Implement + + collection.Add (table); + } + + return (TableSchema[]) collection.ToArray (typeof (TableSchema)); + } + + public override ViewSchema[] GetViews () + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection"); + + ArrayList collection = new ArrayList (); + + MySqlCommand command = new MySqlCommand (); + command.Connection = Connection; + command.CommandText = + ""; + MySqlDataReader r = command.ExecuteReader (); + + while (r.Read ()) { + ViewSchema view = new ViewSchema (); + view.Provider = this; + + // TODO: Implement + + collection.Add (view); + } + + return (ViewSchema[]) collection.ToArray (typeof (ViewSchema)); + } + + public override ColumnSchema[] GetTableColumns (TableSchema table) + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection"); + + ArrayList collection = new ArrayList (); + + MySqlCommand command = new MySqlCommand (); + command.Connection = Connection; + command.CommandText = + ""; + MySqlDataReader r = command.ExecuteReader (); + + while (r.Read ()) { + ColumnSchema column = new ColumnSchema (); + column.Provider = this; + + // TODO: Implement + + collection.Add (column); + } + + return (ColumnSchema[]) collection.ToArray (typeof (ColumnSchema)); + } + + public override ColumnSchema[] GetViewColumns (ViewSchema table) + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection"); + + ArrayList collection = new ArrayList (); + + MySqlCommand command = new MySqlCommand (); + command.Connection = Connection; + command.CommandText = + ""; + MySqlDataReader r = command.ExecuteReader (); + + while (r.Read ()) { + ColumnSchema column = new ColumnSchema (); + column.Provider = this; + + // TODO: Implement + + collection.Add (column); + } + + return (ColumnSchema[]) collection.ToArray (typeof (ColumnSchema)); + } + + public override ConstraintSchema[] GetTableConstraints (TableSchema table) + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection"); + + ArrayList collection = new ArrayList (); + + MySqlCommand command = new MySqlCommand (); + command.Connection = Connection; + command.CommandText = + ""; + MySqlDataReader r = command.ExecuteReader (); + + while (r.Read ()) { + ConstraintSchema constraint = new ConstraintSchema (); + constraint.Provider = this; + + // TODO: Implement + + collection.Add (constraint); + } + + return (ConstraintSchema[]) collection.ToArray ( + typeof (ConstraintSchema)); + } + } +} Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/NpgsqlDbProvider.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/NpgsqlDbProvider.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/NpgsqlDbProvider.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,595 @@ +// +// Provider/NpgsqlDbProvider.cs +// +// Authors: +// Christian Hergert +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.Collections; +using System.Data; +using System.Text; +using System.Text.RegularExpressions; + +using Npgsql; + +namespace Mono.Data.Sql +{ + /// + /// Mono.Data.Sql provider for PostgreSQL databases. + /// + [Serializable] + public class NpgsqlDbProvider : DbProviderBase + { + protected NpgsqlConnection connection = null; + protected NpgsqlDataAdapter adapter = new NpgsqlDataAdapter(); + protected bool isConnectionStringWrong = false; + + /// + /// Default Constructor + /// + public NpgsqlDbProvider () : base () + { + } + + public override string ProviderName { + get { + return "PostgreSQL Database"; + } + } + + /// + /// Constructor with ADO.NET Npgsql connection. + /// + public NpgsqlDbProvider (NpgsqlConnection conn) + { + connection = conn; + } + + /// + /// ADO.NET Connection + /// + public override IDbConnection Connection { + get { + if (connection == null) + connection = new NpgsqlConnection(); + + return (IDbConnection) connection; + } + } + + /// + /// Connection String + /// + public override string ConnectionString { + get { + return Connection.ConnectionString; + } + set { + if (IsOpen == true) + Close(); + + Connection.ConnectionString = value; + isConnectionStringWrong = false; + } + } + + /// + /// Is the connection open + /// + public override bool IsOpen { + get { + return Connection.State == ConnectionState.Open; + } + } + + /// + /// Is the last used connection string wrong + /// + public override bool IsConnectionStringWrong { + get { + return isConnectionStringWrong; + } + } + + /// + /// Last system OID used in postgres to monitor system vs user + /// objects. This varies based on the connections Server Version. + /// + protected int LastSystemOID { + get { + int major = connection.ServerVersion.Major; + int minor = connection.ServerVersion.Minor; + + if (major == 8) + return 17137; + else if (major == 7 && minor == 1) + return 18539; + else if (major == 7 && minor == 2) + return 16554; + else if (major == 7 && minor == 3) + return 16974; + else if (major == 7 && minor == 4) + return 17137; + else + return 17137; + } + } + + /// + /// Open the connection. Returns true on success. + /// + public override bool Open() + { + try { + Connection.Open(); + } catch { + isConnectionStringWrong = true; + } + OnOpen (); + return IsOpen; + } + + /// + /// Close the database connection. + /// + public override void Close() + { + Connection.Close(); + OnClose(); + } + + /// + /// Do we support the passed schema type + /// + public override bool SupportsSchemaType(Type type) + { + if (type == typeof(TableSchema)) + return true; + else if (type == typeof(ViewSchema)) + return true; + else if (type == typeof(ProcedureSchema)) + return true; + else if (type == typeof(AggregateSchema)) + return true; + else if (type == typeof(GroupSchema)) + return true; + else if (type == typeof(UserSchema)) + return true; + else if (type == typeof(LanguageSchema)) + return true; + else if (type == typeof(OperatorSchema)) + return true; + else if (type == typeof(RoleSchema)) + return true; + else if (type == typeof(SequenceSchema)) + return true; + else if (type == typeof(DataTypeSchema)) + return true; + else if (type == typeof(TriggerSchema)) + return true; + else if (type == typeof(RuleSchema)) + return true; + else + return false; + } + + /// + /// Thread safe SQL execution. + /// + public override DataTable ExecuteSQL(string SQLText) + { + NpgsqlCommand command = new NpgsqlCommand(); + command.Connection = connection; + command.CommandText = SQLText; + + DataSet resultSet = new DataSet (); + + lock(adapter) { + adapter.SelectCommand = command; + adapter.Fill(resultSet); + } + + return resultSet.Tables[0]; + } + + /// + /// Get a list of tables in the system. + /// + public override TableSchema[] GetTables() + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection"); + + ArrayList collection = new ArrayList (); + + NpgsqlCommand command = new NpgsqlCommand(); + command.Connection = connection; + command.CommandText = + "SELECT c.relname, n.nspname, u.usename, d.description " + + "FROM pg_class c " + + " LEFT JOIN pg_description d ON c.oid = d.objoid, " + + "pg_namespace n, pg_user u " + + "WHERE c.relnamespace = n.oid " + + "AND c.relowner = u.usesysid " + + "AND c.relkind='r' AND NOT EXISTS " + + " (SELECT 1 FROM pg_rewrite r " + + " WHERE r.ev_class = c.oid AND r.ev_type = '1') " + + "ORDER BY relname;"; + NpgsqlDataReader r = command.ExecuteReader(); + + while (r.Read()) { + TableSchema table = new TableSchema(); + table.Provider = this; + table.Name = r.GetString(0); + + if (table.Name.Substring(0, 3) == "pg_" || + table.Name.Substring(0, 4) == "sql_") + { + table.IsSystemTable = true; + } + + try { table.SchemaName = r.GetString(1); } catch {} + try { table.OwnerName = r.GetString(2); } catch {} + try { table.Comment = r.GetString(3); } catch {} + + StringBuilder sb = new StringBuilder(); + sb.AppendFormat ("-- Table: {0}\n", table.Name); + sb.AppendFormat ("-- DROP TABLE {0};\n\n", table.Name); + sb.AppendFormat ("CREATE TABLE {0} (\n", table.Name); + + ColumnSchema[] columns = table.Columns; + string[] parts = new string[columns.Length]; + for (int i = 0; i < parts.Length; i++) { + parts[i] = "\t" + columns[i].Definition; + } + sb.Append (String.Join (",\n", parts)); + + ConstraintSchema[] cons = table.Constraints; + parts = new string[cons.Length]; + if (cons.Length > 0) + sb.Append (",\n"); + for (int i = 0; i < parts.Length; i++) { + parts[i] = "\t" + cons[i].Definition; + } + sb.Append (String.Join (",\n", parts)); + + sb.Append ("\n);\n"); + sb.AppendFormat ("COMMENT ON TABLE {0} IS '{1}';", table.Name, table.Comment); + table.Definition = sb.ToString(); + collection.Add (table); + } + + return (TableSchema[]) collection.ToArray (typeof (TableSchema)); + } + + /// + /// Get columns for a table. + /// + public override ColumnSchema[] GetTableColumns(TableSchema table) + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection"); + + ArrayList collection = new ArrayList(); + + NpgsqlCommand command = new NpgsqlCommand(); + command.Connection = connection; + command.CommandText = "SELECT a.attname, a.attnotnull, a.attlen, " + + "typ.typname, adef.adsrc " + + "FROM " + + " pg_catalog.pg_attribute a LEFT JOIN " + + " pg_catalog.pg_attrdef adef " + + " ON a.attrelid=adef.adrelid " + + " AND a.attnum=adef.adnum " + + " LEFT JOIN pg_catalog.pg_type t ON a.atttypid=t.oid, " + + " pg_catalog.pg_type typ " + + "WHERE " + + " a.attrelid = (SELECT oid FROM pg_catalog.pg_class " + + " WHERE relname='" + table.Name + "') " + + "AND a.attnum > 0 AND NOT a.attisdropped " + + "AND a.atttypid = typ.oid " + + "ORDER BY a.attnum;"; + NpgsqlDataReader r = command.ExecuteReader(); + + while (r.Read()) { + ColumnSchema column = new ColumnSchema(); + + try { column.Name = r.GetString(0); } catch {} + column.Provider = this; + try { column.DataTypeName = r.GetString(3); } catch {} + try { column.Default = r.GetString(4); } catch {} + column.Comment = ""; + column.OwnerName = ""; + column.SchemaName = table.SchemaName; + try { column.NotNull = r.GetBoolean(1); } catch {} + try { column.Length = r.GetInt32(2); } catch {} + + StringBuilder sb = new StringBuilder(); + sb.AppendFormat("{0} {1}{2}", + column.Name, + column.DataTypeName, + (column.Length > 0) ? ("(" + column.Length + ")") : ""); + sb.AppendFormat(" {0}", column.NotNull ? "NOT NULL" : "NULL"); + if (column.Default.Length > 0) + sb.AppendFormat(" DEFAULT {0}", column.Default); + column.Definition = sb.ToString(); + + collection.Add(column); + } + + return (ColumnSchema[]) collection.ToArray(typeof(ColumnSchema)); + } + + /// + /// Get a collection of views from the system. + /// + public override ViewSchema[] GetViews() + { + ArrayList collection = new ArrayList(); + + NpgsqlCommand command = new NpgsqlCommand(); + command.Connection = connection; + command.CommandText = + "SELECT v.schemaname, v.viewname, v.viewowner, v.definition," + + " (c.oid <= " + LastSystemOID + "), " + + "(SELECT description from pg_description pd, " + + " pg_class pc WHERE pc.oid=pd.objoid AND pc.relname=" + + " v.viewname) " + + "FROM pg_views v, pg_class c " + + "WHERE v.viewname = c.relname " + + "ORDER BY viewname"; + NpgsqlDataReader r = command.ExecuteReader(); + + while (r.Read()) { + ViewSchema view = new ViewSchema(); + view.Provider = this; + + try { + view.Name = r.GetString(1); + view.SchemaName = r.GetString(0); + view.OwnerName = r.GetString(2); + + StringBuilder sb = new StringBuilder(); + sb.AppendFormat ("-- View: {0}\n", view.Name); + sb.AppendFormat ("-- DROP VIEW {0};\n\n", view.Name); + sb.AppendFormat ("CREATE VIEW {0} AS (\n", view.Name); + string core = r.GetString(3); + sb.AppendFormat (" {0}\n);", core.Substring (0, core.Length-1)); + view.Definition = sb.ToString (); + + view.IsSystemView = (r.GetBoolean(4)); + view.Comment = r.GetString(5); + } catch (Exception e) { + } + + + + collection.Add(view); + } + + return (ViewSchema[]) collection.ToArray (typeof (ViewSchema)); + } + + /// + /// Get a collection of columns within a view + /// + public override ColumnSchema[] GetViewColumns(ViewSchema view) + { + if (IsOpen == false && Open() == false) + throw new Exception ("No connection to database"); + + ArrayList collection = new ArrayList(); + + NpgsqlCommand command = new NpgsqlCommand (); + command.Connection = connection; + command.CommandText = + "SELECT attname, typname, attlen, attnotnull " + + "FROM " + + " pg_catalog.pg_attribute a LEFT JOIN pg_catalog.pg_attrdef adef " + + " ON a.attrelid=adef.adrelid " + + " AND a.attnum=adef.adnum " + + " LEFT JOIN pg_catalog.pg_type t ON a.atttypid=t.oid " + + "WHERE " + + " a.attrelid = (SELECT oid FROM pg_catalog.pg_class WHERE relname='" + + view.Name + "') " + + " AND a.attnum > 0 AND NOT a.attisdropped " + + " ORDER BY a.attnum;"; + NpgsqlDataReader r = command.ExecuteReader(); + + while (r.Read()) { + ColumnSchema column = new ColumnSchema(); + + try { + column.Name = r.GetString(0); + column.Provider = this; + column.DataTypeName = r.GetString(1); + column.Default = ""; + column.SchemaName = view.SchemaName; + column.Definition = ""; + column.NotNull = r.GetBoolean(3); + column.Length = r.GetInt32(2); + } catch { + } finally { + collection.Add(column); + } + } + + return (ColumnSchema[]) collection.ToArray (typeof(ColumnSchema)); + } + + /// + /// Get a collection of constraints within a a table. + /// + public override ConstraintSchema[] GetTableConstraints (TableSchema table) + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection"); + + ArrayList collection = new ArrayList (); + + NpgsqlCommand command = new NpgsqlCommand (); + command.Connection = connection; + command.CommandText = String.Format ( + "SELECT " + + "pc.conname, " + + "pg_catalog.pg_get_constraintdef(pc.oid, true) AS consrc, " + + "pc.contype, " + + "CASE WHEN pc.contype='u' OR pc.contype='p' THEN ( " + + " SELECT " + + " indisclustered " + + " FROM " + + " pg_catalog.pg_depend pd, " + + " pg_catalog.pg_class pl, " + + " pg_catalog.pg_index pi " + + " WHERE " + + " pd.refclassid=pc.tableoid " + + " AND pd.refobjid=pc.oid " + + " AND pd.objid=pl.oid " + + " AND pl.oid=pi.indexrelid " + + ") ELSE " + + " NULL " + + "END AS indisclustered " + + "FROM " + + "pg_catalog.pg_constraint pc " + + "WHERE " + + "pc.conrelid = (SELECT oid FROM pg_catalog.pg_class WHERE relname='{0}' " + + " AND relnamespace = (SELECT oid FROM pg_catalog.pg_namespace " + + " WHERE nspname='{1}')) " + + "ORDER BY " + + "1;", table.Name, table.SchemaName); + NpgsqlDataReader r = command.ExecuteReader (); + + while (r.Read ()) { + ConstraintSchema constraint = null; + switch (r.GetString(2)) { + case "p": + default: + constraint = new PrimaryKeyConstraintSchema(); + break; + } + + constraint.Name = r.GetString (0); + constraint.Definition = r.GetString (1); + + collection.Add (constraint); + } + + return (ConstraintSchema[]) collection.ToArray (typeof(ConstraintSchema)); + } + + public override UserSchema[] GetUsers () + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection"); + + ArrayList collection = new ArrayList (); + + // TODO: Implement + + return (UserSchema[]) collection.ToArray (typeof (UserSchema)); + } + + public override ProcedureSchema[] GetProcedures () + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection"); + + ArrayList collection = new ArrayList (); + + NpgsqlCommand command = new NpgsqlCommand (); + command.Connection = connection; + command.CommandText = + "SELECT pc.proname, pc.oid::integer, pl.lanname, pc.prosrc " + + "FROM " + + " pg_proc pc, " + + " pg_user pu, " + + " pg_type pt, " + + " pg_language pl " + + "WHERE pc.proowner = pu.usesysid " + + "AND pc.prorettype = pt.oid " + + "AND pc.prolang = pl.oid " + + "UNION " + + "SELECT pc.proname, pt.oid::integer, pl.lanname, pc.prosrc " + + "FROM " + + " pg_proc pc, " + + " pg_user pu, " + + " pg_type pt, " + + " pg_language pl " + + "WHERE pc.proowner = pu.usesysid " + + "AND pc.prorettype = 0 " + + "AND pc.prolang = pl.oid;"; + NpgsqlDataReader r = command.ExecuteReader (); + + while (r.Read ()) { + ProcedureSchema procedure = new ProcedureSchema (); + + procedure.Provider = this; + procedure.Name = r.GetString (0); + procedure.Definition = r.GetString (3); + procedure.LanguageName = r.GetString (2); + + try { + if (r.GetInt32 (1) <= LastSystemOID) + procedure.IsSystemProcedure = true; + } catch {} + + collection.Add (procedure); + } + + + return (ProcedureSchema[]) collection.ToArray (typeof (ProcedureSchema)); + } + + public override ColumnSchema[] GetProcedureColumns (ProcedureSchema schema) + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection"); + + ArrayList collection = new ArrayList (); + + // FIXME: Won't work properly with overload functions. + NpgsqlCommand command = new NpgsqlCommand (); + command.Connection = connection; + command.CommandText = String.Format ( + "SELECT format_type (prorettype, NULL) " + + "FROM pg_proc pc, pg_language pl " + + "WHERE pc.prolang = pl.oid " + + "AND pc.proname = '{0}';", schema.Name); + NpgsqlDataReader r = command.ExecuteReader (); + + while (r.Read ()) { + ColumnSchema column = new ColumnSchema (); + column.Provider = this; + + column.DataTypeName = r.GetString (0); + column.Name = r.GetString (0); + + collection.Add (column); + } + + return (ColumnSchema[]) collection.ToArray (typeof (ColumnSchema)); + } + } +} Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/OracleDbProvider.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/OracleDbProvider.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/OracleDbProvider.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,432 @@ +// +// Provider/OracleDbProvider.cs +// +// Authors: +// Christian Hergert +// Daniel Morgan +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// Copyright (C) 2005 Daniel Morgan +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.Collections; +using System.Data; +using System.Text; +using System.Text.RegularExpressions; + +using System.Data.OracleClient; + +namespace Mono.Data.Sql +{ + /// + /// Mono.Data.Sql provider for Orace databases. + /// + [Serializable] + public class OracleDbProvider : DbProviderBase + { + protected OracleConnection connection = null; + protected OracleDataAdapter adapter = new OracleDataAdapter(); + protected bool isConnectionStringWrong = false; + + public override string ProviderName { + get { + return "Oracle 8i/9i/10g"; + } + } + + /// + /// ADO.NET Connection + /// + public override IDbConnection Connection { + get { + if (connection == null) { + connection = new OracleConnection(); + } + + return (IDbConnection) connection; + } + } + + /// + /// Connection String + /// + public override string ConnectionString { + get { + return Connection.ConnectionString; + } + set { + if (IsOpen == true) + Close(); + + Connection.ConnectionString = value; + isConnectionStringWrong = false; + } + } + + /// + /// Is the connection open + /// + public override bool IsOpen { + get { + return Connection.State == ConnectionState.Open; + } + } + + /// + /// Is the last used connection string wrong + /// + public override bool IsConnectionStringWrong { + get { + return isConnectionStringWrong; + } + } + + /// + /// Open the connection. Returns true on success. + /// + public override bool Open() + { + try { + Connection.Open(); + } catch { + isConnectionStringWrong = true; + } + OnOpen(); + return IsOpen; + } + + /// + /// Close the database connection. + /// + public override void Close() + { + Connection.Close(); + OnClose(); + } + + /// + /// Do we support the passed schema type + /// + public override bool SupportsSchemaType(Type type) + { + if (type == typeof(TableSchema)) + return true; + else if (type == typeof(ViewSchema)) + return true; + else if (type == typeof(ProcedureSchema)) + return true; + else if (type == typeof(AggregateSchema)) + return true; + else if (type == typeof(GroupSchema)) + return true; + else if (type == typeof(UserSchema)) + return true; + else if (type == typeof(LanguageSchema)) + return true; + else if (type == typeof(OperatorSchema)) + return true; + else if (type == typeof(RoleSchema)) + return true; + else if (type == typeof(SequenceSchema)) + return true; + else if (type == typeof(DataTypeSchema)) + return true; + else if (type == typeof(TriggerSchema)) + return true; + else if (type == typeof(RuleSchema)) + return true; + else + return false; + } + + /// + /// Thread safe SQL execution. + /// + public override DataTable ExecuteSQL(string SQLText) + { + OracleCommand command = new OracleCommand(); + command.Connection = connection; + command.CommandText = SQLText; + + DataSet resultSet = null; + + lock(adapter) { + adapter.SelectCommand = command; + adapter.Fill(resultSet); + } + + return resultSet.Tables[0]; + } + + private bool IsSystem(string owner) + { + switch(owner) { + case "SYSTEM": + case "SYS": + case "DRSYS": + case "CTXSYS": + case "MDSYS": + case "WKSYS": + return true; + } + + return false; + } + + + /// + /// Get a list of tables in the system. + /// + public override TableSchema[] GetTables() + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection."); + + ArrayList collection = new ArrayList(); + + OracleCommand command = new OracleCommand(); + command.Connection = connection; + command.CommandText = + "SELECT OWNER, TABLE_NAME, TABLESPACE_NAME " + + "FROM ALL_TABLES " + + "ORDER BY OWNER, TABLE_NAME"; + OracleDataReader r = command.ExecuteReader(); + + while (r.Read()) { + TableSchema table = new TableSchema(); + table.Provider = this; + table.OwnerName = r.GetValue(0).ToString(); + table.SchemaName = r.GetValue(0).ToString(); + table.Name = r.GetString(1).ToString(); + table.IsSystemTable = IsSystem(table.OwnerName); + table.TableSpaceName = r.GetValue(2).ToString(); + + StringBuilder sb = new StringBuilder(); + sb.AppendFormat ("-- Table: {0}\n", table.Name); + sb.AppendFormat ("-- DROP TABLE {0};\n\n", table.Name); + sb.AppendFormat ("CREATE TABLE {0} (\n", table.Name); + + ColumnSchema[] columns = table.Columns; + string[] parts = new string[columns.Length]; + for (int i = 0; i < parts.Length; i++) { + parts[i] = "\t" + columns[i].Definition; + } + sb.Append (String.Join (",\n", parts)); + + ConstraintSchema[] cons = table.Constraints; + parts = new string[cons.Length]; + if (cons.Length > 0) + sb.Append (",\n"); + for (int i = 0; i < parts.Length; i++) { + parts[i] = "\t" + cons[i].Definition; + } + sb.Append (String.Join (",\n", parts)); + + //sb.AppendFormat ("\n) COMMENT '{0}';", table.Comment); + table.Definition = ""; + collection.Add (table); + } + + return (TableSchema[]) collection.ToArray(typeof(TableSchema)); + } + + private int GetInt (IDataReader reader, int field) + { + if (reader.IsDBNull(field) == true) + return 0; + + object v = reader.GetValue(field); + string ds = v.ToString(); + int iss = Int32.Parse(ds); + return iss; + } + + /// + /// Get columns for a table. + /// + public override ColumnSchema[] GetTableColumns(TableSchema table) + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection."); + + ArrayList collection = new ArrayList(); + + OracleCommand command = new OracleCommand(); + command.Connection = connection; + command.CommandText = + "SELECT OWNER, TABLE_NAME, COLUMN_NAME, " + + " DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE, " + + " NULLABLE, COLUMN_ID, DEFAULT_LENGTH, DATA_DEFAULT " + + "FROM ALL_TAB_COLUMNS " + + "WHERE OWNER = '" + table.OwnerName + "' " + + "AND TABLE_NAME = '" + table.Name + "' " + + "ORDER BY OWNER, TABLE_NAME, COLUMN_ID"; + OracleDataReader r = command.ExecuteReader(); + + while (r.Read()) { + ColumnSchema column = new ColumnSchema(); + + try { column.Name = r.GetValue(2).ToString(); } catch {} + column.Provider = this; + try { column.DataTypeName = r.GetValue(3).ToString(); } catch {} + column.Default = ""; + column.Comment = ""; + column.OwnerName = table.OwnerName; + column.SchemaName = table.OwnerName; + + try { column.NotNull = r.GetValue(7).ToString() == "Y" ? true : false; } catch {} + + try { column.Length = GetInt(r, 4); } catch {} + try { column.Precision = GetInt(r, 5); } catch {} + try { column.Scale = GetInt(r, 6); } catch {} + + try { column.ColumnID = GetInt(r, 8); } catch {} + + StringBuilder sb = new StringBuilder(); + sb.AppendFormat("{0} {1}{2}", + column.Name, + column.DataTypeName, + (column.Length > 0) ? ("(" + column.Length + ")") : ""); + sb.AppendFormat(" {0}", column.NotNull ? "NOT NULL" : "NULL"); + //if (column.Default.Length > 0) + // sb.AppendFormat(" DEFAULT {0}", column.Default); + column.Definition = sb.ToString(); + + collection.Add(column); + } + + return (ColumnSchema[]) collection.ToArray(typeof(ColumnSchema)); + } + + /// + /// Get a collection of views from the system. + /// + public override ViewSchema[] GetViews() + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection."); + + ArrayList collection = new ArrayList(); + + OracleCommand command = new OracleCommand(); + command.Connection = connection; + command.CommandText = + "SELECT OWNER, VIEW_NAME, TEXT " + + "FROM ALL_VIEWS " + + "ORDER BY OWNER, VIEW_NAME"; + OracleDataReader r = command.ExecuteReader(); + + while (r.Read()) { + ViewSchema view = new ViewSchema(); + view.Provider = this; + + try { + view.Name = r.GetString(1); + view.SchemaName = r.GetString(0); + view.OwnerName = r.GetString(0); + view.Definition = r.GetString(2); + view.IsSystemView = IsSystem(view.OwnerName); + view.Comment = ""; + } catch (Exception e) { + } + + collection.Add(view); + } + + return (ViewSchema[]) collection.ToArray (typeof(ViewSchema)); + } + + /// + /// Get a collection of columns within a view + /// + public override ColumnSchema[] GetViewColumns(ViewSchema view) + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection."); + + ArrayList collection = new ArrayList(); + + OracleCommand command = new OracleCommand (); + command.Connection = connection; + command.CommandText = + "SELECT * " + + " FROM " + view.Name + + " WHERE 1 = 0"; + OracleDataReader r = command.ExecuteReader(); + + for (int i = 0; i < r.FieldCount; i++) { + ColumnSchema column = new ColumnSchema(); + + column.Name = r.GetName(i); + column.DataTypeName = r.GetDataTypeName(i); + column.Default = ""; + column.Definition = ""; + column.OwnerName = view.OwnerName; + column.SchemaName = view.OwnerName; + + collection.Add(column); + } + + return (ColumnSchema[]) collection.ToArray (typeof(ColumnSchema)); + } + + /// + /// Get a collection of constraints within a a table. + /// + public override ConstraintSchema[] GetTableConstraints (TableSchema table) + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection."); + + ArrayList collection = new ArrayList (); + + OracleCommand command = new OracleCommand (); + command.Connection = connection; + command.CommandText = + "SELECT k.owner, k.table_name, k.constraint_name, " + + " k.constraint_type, k.status, k.validated " + + "FROM all_constraints k " + + "WHERE k.owner = '" + table.OwnerName + "' " + + "AND k.table_name = '" + table.Name + "' " + + "and k.constraint_type = 'P'"; + OracleDataReader r = command.ExecuteReader (); + + while (r.Read ()) { + ConstraintSchema constraint = null; + switch (r.GetString(4)) { + case "P": + default: + constraint = new PrimaryKeyConstraintSchema(); + break; + } + + constraint.Name = r.GetString (3); + constraint.Definition = ""; + + collection.Add (constraint); + } + + return (ConstraintSchema[]) collection.ToArray (typeof(ConstraintSchema)); + } + } +} Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/SqlDbProvider.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/SqlDbProvider.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/SqlDbProvider.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,533 @@ +// +// Provider/SqlDbProvider.cs +// +// Authors: +// Christian Hergert +// Daniel Morgan +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.Collections; +using System.Data; +using System.Text; +using System.Text.RegularExpressions; + +using System.Data.SqlClient; + +namespace Mono.Data.Sql +{ + /// + /// Mono.Data.Sql provider for PostgreSQL databases. + /// + [Serializable] + public class SqlDbProvider : DbProviderBase + { + protected SqlConnection connection = null; + protected SqlDataAdapter adapter = new SqlDataAdapter(); + protected bool isConnectionStringWrong = false; + + /// + /// Default Constructor + /// + public SqlDbProvider () : base () + { + } + + public override string ProviderName { + get { + return "SQL Server Database"; + } + } + + /// + /// Constructor with ADO.NET Sql connection. + /// + public SqlDbProvider (SqlConnection conn) + { + connection = conn; + } + + /// + /// ADO.NET Connection + /// + public override IDbConnection Connection { + get { + if (connection == null) + connection = new SqlConnection(); + + return (IDbConnection) connection; + } + } + + /// + /// Connection String + /// + public override string ConnectionString { + get { + return Connection.ConnectionString; + } + set { + if (IsOpen == true) + Close(); + + Connection.ConnectionString = value; + isConnectionStringWrong = false; + } + } + + /// + /// Is the connection open + /// + public override bool IsOpen { + get { + return Connection.State == ConnectionState.Open; + } + } + + /// + /// Is the last used connection string wrong + /// + public override bool IsConnectionStringWrong { + get { + return isConnectionStringWrong; + } + } + + /// + /// Open the connection. Returns true on success. + /// + public override bool Open() + { + try { + Connection.Open(); + } catch { + isConnectionStringWrong = true; + } + OnOpen (); + return IsOpen; + } + + /// + /// Close the database connection. + /// + public override void Close() + { + Connection.Close(); + OnClose(); + } + + /// + /// Do we support the passed schema type + /// + public override bool SupportsSchemaType(Type type) + { + if (type == typeof(TableSchema)) + return true; + else if (type == typeof(ViewSchema)) + return true; + else if (type == typeof(ProcedureSchema)) + return true; + else if (type == typeof(AggregateSchema)) + return true; + else if (type == typeof(GroupSchema)) + return true; + else if (type == typeof(UserSchema)) + return true; + else if (type == typeof(LanguageSchema)) + return true; + else if (type == typeof(OperatorSchema)) + return true; + else if (type == typeof(RoleSchema)) + return true; + else if (type == typeof(SequenceSchema)) + return true; + else if (type == typeof(DataTypeSchema)) + return true; + else if (type == typeof(TriggerSchema)) + return true; + else if (type == typeof(RuleSchema)) + return true; + else + return false; + } + + /// + /// Thread safe SQL execution. + /// + public override DataTable ExecuteSQL(string SQLText) + { + SqlCommand command = new SqlCommand(); + command.Connection = connection; + command.CommandText = SQLText; + + DataSet resultSet = new DataSet (); + + lock(adapter) { + adapter.SelectCommand = command; + adapter.Fill(resultSet); + } + + return resultSet.Tables[0]; + } + + /// + /// Get a list of tables in the system. + /// + public override TableSchema[] GetTables() + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection"); + + ArrayList collection = new ArrayList (); + + SqlCommand command = new SqlCommand(); + command.Connection = connection; + command.CommandText = + "SELECT su.name AS owner, so.name as table_name, so.id as table_id, " + + " so.crdate as created_date, so.xtype as table_type " + + " FROM dbo.sysobjects so, dbo.sysusers su " + + "WHERE xtype IN ('S','U') " + + "AND su.uid = so.uid " + + "ORDER BY 1, 2"; + SqlDataReader r = command.ExecuteReader(); + + while (r.Read()) { + TableSchema table = new TableSchema(); + table.Provider = this; + table.Name = r.GetString(1); + + table.IsSystemTable = r.GetString(4) == "S" ? true : false; + + table.SchemaName = r.GetString(0); + table.OwnerName = r.GetString(0); + table.Comment = ""; + + StringBuilder sb = new StringBuilder(); + sb.AppendFormat ("-- Table: {0}\n", table.Name); + sb.AppendFormat ("-- DROP TABLE {0};\n\n", table.Name); + sb.AppendFormat ("CREATE TABLE {0} (\n", table.Name); + + ColumnSchema[] columns = table.Columns; + string[] parts = new string[columns.Length]; + for (int i = 0; i < parts.Length; i++) { + parts[i] = "\t" + columns[i].Definition; + } + sb.Append (String.Join (",\n", parts)); + + ConstraintSchema[] cons = table.Constraints; + parts = new string[cons.Length]; + if (cons.Length > 0) + sb.Append (",\n"); + for (int i = 0; i < parts.Length; i++) { + parts[i] = "\t" + cons[i].Definition; + } + sb.Append (String.Join (",\n", parts)); + + sb.Append ("\n);\n"); + //sb.AppendFormat ("COMMENT ON TABLE {0} IS '{1}';", table.Name, table.Comment); + table.Definition = sb.ToString(); + collection.Add (table); + } + r.Close (); + r = null; + command.Dispose (); + command = null; + + return (TableSchema[]) collection.ToArray (typeof (TableSchema)); + } + + /// + /// Get columns for a table. + /// + public override ColumnSchema[] GetTableColumns(TableSchema table) + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection"); + + ArrayList collection = new ArrayList(); + SqlConnection con2 = (SqlConnection) (((ICloneable) connection).Clone ()); + if (con2.State == ConnectionState.Closed) + con2.Open(); + SqlCommand command = con2.CreateCommand (); + + command.CommandText = + "SELECT su.name as owner, so.name as table_name, " + + " sc.name as column_name, " + + " st.name as date_type, sc.length as column_length, " + + " sc.xprec as data_preceision, sc.xscale as data_scale, " + + " sc.isnullable, sc.colid as column_id " + + "FROM dbo.syscolumns sc, dbo.sysobjects so, " + + " dbo.systypes st, dbo.sysusers su " + + "WHERE sc.id = so.id " + + "AND so.xtype in ('U','S') " + + "AND so.name = 'employee' " + + "AND su.name = 'dbo' " + + "AND sc.xusertype = st.xusertype " + + "AND su.uid = so.uid " + + "ORDER BY sc.colid"; + SqlDataReader r = command.ExecuteReader(); + + while (r.Read()) { + ColumnSchema column = new ColumnSchema(); + + try { column.Name = r.GetString(2); } catch {} + column.Provider = this; + try { column.DataTypeName = r.GetString(3); } catch {} + try { column.Default = ""; } catch {} + column.Comment = ""; + column.OwnerName = table.OwnerName; + column.SchemaName = table.OwnerName; + try { column.NotNull = r.GetValue(7).ToString() == "0" ? true : false; } catch {} + try { column.Length = r.GetInt32(4); } catch {} + //try { column.Precision = GetInt(r, 5)); } catch {} + //try { column.Scale = GetIn(r, 6); } catch {} + + StringBuilder sb = new StringBuilder(); + sb.AppendFormat("{0} {1}{2}", + column.Name, + column.DataTypeName, + (column.Length > 0) ? ("(" + column.Length + ")") : ""); + sb.AppendFormat(" {0}", column.NotNull ? "NOT NULL" : "NULL"); + //if (column.Default.Length > 0) + // sb.AppendFormat(" DEFAULT {0}", column.Default); + column.Definition = sb.ToString(); + + collection.Add(column); + } + r.Close (); + r = null; + command.Dispose (); + command = null; + con2.Close (); + con2 = null; + + return (ColumnSchema[]) collection.ToArray(typeof(ColumnSchema)); + } + + private string GetSource (string objectName) + { + string sql = String.Format ("EXEC [master].[dbo].[sp_helptext] '{0}', null", objectName); + SqlConnection con2 = (SqlConnection) (((ICloneable) connection).Clone ()); + if (con2.State == ConnectionState.Closed) + con2.Open(); + SqlCommand cmd = con2.CreateCommand (); + cmd.CommandText = sql; + IDataReader reader = cmd.ExecuteReader (); + + StringBuilder sb = new StringBuilder (); + + while (reader.Read ()) { + string text = reader.GetString (0); + sb.Append (text); + } + + reader.Close (); + reader = null; + cmd.Dispose (); + cmd = null; + con2.Close (); + con2 = null; + + return sb.ToString (); + } + + /// + /// Get a collection of views from the system. + /// + public override ViewSchema[] GetViews() + { + ArrayList collection = new ArrayList(); + + SqlCommand command = new SqlCommand(); + command.Connection = connection; + command.CommandText = + "SELECT su.name AS owner, so.name as table_name, so.id as table_id, " + + " so.crdate as created_date, so.xtype as table_type " + + "FROM dbo.sysobjects so, dbo.sysusers su " + + "WHERE xtype = 'V' " + + "AND su.uid = so.uid " + + "ORDER BY 1, 2"; + SqlDataReader r = command.ExecuteReader(); + + while (r.Read()) { + ViewSchema view = new ViewSchema(); + view.Provider = this; + + try { + view.Name = r.GetString(1); + view.SchemaName = r.GetString(0); + view.OwnerName = r.GetString(0); + + StringBuilder sb = new StringBuilder(); + sb.AppendFormat ("-- View: {0}\n", view.Name); + sb.AppendFormat ("-- DROP VIEW {0};\n\n", view.Name); + string source = GetSource(view.Owner + "." + view.Name); + sb.AppendFormat (" {0}\n);", source); + view.Definition = sb.ToString (); + //view.Comment = r.GetString(5); + } catch (Exception e) { + } + + collection.Add(view); + } + r.Close (); + r = null; + command.Dispose(); + command = null; + + return (ViewSchema[]) collection.ToArray (typeof (ViewSchema)); + } + + /// + /// Get a collection of columns within a view + /// + public override ColumnSchema[] GetViewColumns(ViewSchema view) + { + if (IsOpen == false && Open() == false) + throw new Exception ("No connection to database"); + + ArrayList collection = new ArrayList(); + + SqlConnection con2 = (SqlConnection) (((ICloneable) connection).Clone ()); + if (con2.State == ConnectionState.Closed) + con2.Open(); + SqlCommand command = con2.CreateCommand (); + command.CommandText = + "SELECT * " + + " FROM " + view.Name + + " WHERE 1 = 0"; + SqlDataReader r = command.ExecuteReader(); + + for (int i = 0; i < r.FieldCount; i++) { + ColumnSchema column = new ColumnSchema(); + + column.Name = r.GetName(i); + column.DataTypeName = r.GetDataTypeName(i); + column.Default = ""; + column.Definition = ""; + column.OwnerName = view.OwnerName; + column.SchemaName = view.OwnerName; + + collection.Add(column); + } + + command.Dispose (); + command = null; + con2.Close (); + con2 = null; + + return (ColumnSchema[]) collection.ToArray (typeof(ColumnSchema)); + } + + /// + /// Get a collection of constraints within a a table. + /// + public override ConstraintSchema[] GetTableConstraints (TableSchema table) + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection"); + + ArrayList collection = new ArrayList (); + + SqlConnection con2 = (SqlConnection) (((ICloneable) connection).Clone ()); + if (con2.State == ConnectionState.Closed) + con2.Open(); + SqlCommand command = con2.CreateCommand (); + command.CommandText = + String.Format ( + "select sox.name, sox.xtype, " + + " so.name as table_name, sc.name as column_name, " + + " sx.constid as constid, sx.id, sx.colid " + + "from dbo.sysconstraints sx, dbo.sysobjects so, dbo.syscolumns sc, " + + " dbo.sysobjects sox " + + "where so.id = sx.id " + + "and sc.id = so.id " + + "and sc.colid = sx.colid " + + "and sox.id = sx.constid " + + "union " + + "select si.name, so.xtype, " + + " sot.name as table_name, sc.name as column_name, " + + " si.indid as constraintid, si.id as tableid, sc.colid as columnid " + + "from sysindexes si, sysindexkeys sk, syscolumns sc, sysobjects so, " + + " sysobjects sot " + + "where si.id = 405576483 " + + "and sot.id = so.parent_obj " + + "and sk.id = si.id " + + "and sc.id = si.id " + + "and sk.id = sc.id " + + "and sk.indid = si.indid " + + "and sk.colid = sc.colid " + + "and so.name = si.name " + + "order by 3, 1, 7", + table.Name, table.OwnerName); + SqlDataReader r = command.ExecuteReader (); + + while (r.Read ()) { + ConstraintSchema constraint = null; + switch (r.GetString(1)) { + case "D": // default constraint + break; + case "C": // check constraint + break; + case "PK": // Primary Key + constraint = new PrimaryKeyConstraintSchema(); + constraint.Name = r.GetString (0); + break; + case "F": // Foreign key + break; + case "UQ": // Unique constraint + break; + default: + break; + } + + + //constraint.Definition = r.GetString (1); + + if (constraint != null) + collection.Add (constraint); + } + r.Close (); + r = null; + command.Dispose (); + command = null; + con2.Close (); + con2 = null; + + return (ConstraintSchema[]) collection.ToArray (typeof(ConstraintSchema)); + } + + public override UserSchema[] GetUsers () + { + if (IsOpen == false && Open () == false) + throw new InvalidOperationException ("Invalid connection"); + + ArrayList collection = new ArrayList (); + + + + return (UserSchema[]) collection.ToArray (typeof (UserSchema)); + } + } +} Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/SqliteDbProvider.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/SqliteDbProvider.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Providers/SqliteDbProvider.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,127 @@ +// +// Providers/SqliteDbProvider.cs +// +// Authors: +// Christian Hergert +// +// Copyright (c) 2005 Christian Hergert +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.Collections; +using System.Data; + +using Mono.Data.SqliteClient; + +namespace Mono.Data.Sql +{ + [Serializable] + public class SqliteDbProvider : DbProviderBase + { + protected SqliteConnection connection = null; + protected SqliteDataAdapter adapter = new SqliteDataAdapter (); + protected bool isConnectionStringWrong = false; + + public override string ProviderName { + get { + return "SQLite Database (Incomplete)"; + } + } + + public override IDbConnection Connection { + get { + if (connection == null) + connection = new SqliteConnection (); + + return (IDbConnection) connection; + } + } + + public override string ConnectionString { + get { + return Connection.ConnectionString; + } + set { + if (IsOpen) + Close (); + + Connection.ConnectionString = value; + isConnectionStringWrong = false; + } + } + + public override bool IsOpen { + get { + return Connection.State == ConnectionState.Open; + } + } + + public override bool IsConnectionStringWrong { + get { + return isConnectionStringWrong; + } + } + + public override bool Open () + { + try { + Connection.Open (); + OnOpen (); + } catch (Exception e) { + isConnectionStringWrong = true; + } + + return IsOpen; + } + + public override void Close () + { + Connection.Close (); + OnClose (); + } + + public override ViewSchema[] GetViews () + { + throw new NotImplementedException (); + } + + public override TableSchema[] GetTables () + { + throw new NotImplementedException (); + } + + public override ColumnSchema[] GetTableColumns (TableSchema table) + { + throw new NotImplementedException (); + } + + public override ColumnSchema[] GetViewColumns (ViewSchema view) + { + throw new NotImplementedException (); + } + + public override ConstraintSchema[] GetTableConstraints (TableSchema table) + { + throw new NotImplementedException (); + } + } +} Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/AbstractSchema.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/AbstractSchema.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/AbstractSchema.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,148 @@ +// +// Schema/AbstractSchema.cs +// +// Authors: +// Christian Hergert +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + +namespace Mono.Data.Sql +{ + public abstract class AbstractSchema : ISchema + { + public event EventHandler Changed; + + protected string name = String.Empty; + protected string ownerName = String.Empty; + protected string comment = String.Empty; + protected string definition = String.Empty; + protected string schema = String.Empty; + protected DbProviderBase provider = null; + + public virtual string Name { + get { + return name; + } + set { + name = value; + OnChanged(); + } + } + + public virtual string FullName { + get { + if (schema.Length > 0) + return schema + "." + name; + else + return name; + } + } + + public virtual string SchemaName { + get { + return schema; + } + set { + schema = value; + OnChanged(); + } + } + + public virtual SchemaSchema Schema { + get { + throw new NotImplementedException(); + } + set { + if (value != null) + schema = value.Name; + else + schema = String.Empty; + } + } + + public virtual string Comment { + get { + return comment; + } + set { + comment = value; + OnChanged(); + } + } + + public virtual string Definition { + get { + return definition; + } + set { + definition = value; + OnChanged(); + } + } + + public DbProviderBase Provider { + get { + return provider; + } + set { + provider = value; + OnChanged(); + } + } + + public virtual string OwnerName { + get { + return ownerName; + } + set { + ownerName = value; + OnChanged(); + } + } + + public virtual UserSchema Owner { + get { + throw new NotImplementedException(); + } + } + + public virtual PrivilegeSchema [] Privileges { + get { + throw new NotImplementedException(); + } + } + + public virtual void OnChanged() + { + if (Changed != null) { + Changed(this, null); + } + } + + public virtual void Refresh() + { + } + } +} Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/AggregateSchema.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/AggregateSchema.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/AggregateSchema.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,40 @@ +// +// Schema/AggregateSchema.cs +// +// Authors: +// Christian Hergert +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + +namespace Mono.Data.Sql +{ + public class AggregateSchema : AbstractSchema + { + public override string ToString() + { + return Name + "()"; + } + } +} \ No newline at end of file Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/CheckConstraintSchema.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/CheckConstraintSchema.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/CheckConstraintSchema.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,36 @@ +// +// Schema/CheckConstraintSchema.cs +// +// Authors: +// Christian Hergert +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + +namespace Mono.Data.Sql +{ + public class CheckConstraintSchema : ConstraintSchema + { + } +} Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ColumnSchema.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ColumnSchema.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ColumnSchema.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,120 @@ +// +// Schema/ColumnSchema.cs +// +// Authors: +// Christian Hergert +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + +namespace Mono.Data.Sql +{ + public class ColumnSchema : AbstractSchema + { + protected string dataType = String.Empty; + protected string defaultValue = String.Empty; + protected bool notNull = false; + protected int length = 0; + protected int precision = 0; + protected int scale = 0; + protected int columnID = 0; + + public DataTypeSchema DataType { + get { + // TODO: Load the datatype based on its name. + throw new NotImplementedException(); + } + } + + public string DataTypeName { + get { + return dataType; + } + set { + dataType = value; + OnChanged (); + } + } + + public virtual string Default { + get { + return defaultValue; + } + set { + defaultValue = value; + OnChanged(); + } + } + + public virtual bool NotNull { + get { + return notNull; + } + set { + notNull = value; + OnChanged(); + } + } + + public virtual int Length { + get { + return length; + } + set { + length = value; + OnChanged(); + } + } + + public virtual int Precision { + get { + return precision; + } + set { + precision = value; + OnChanged (); + } + } + + public virtual int Scale { + get { + return scale; + } + set { + scale = value; + OnChanged (); + } + } + + public virtual int ColumnID { + get { + return columnID; + } + set { + columnID = value; + OnChanged (); + } + } + } +} \ No newline at end of file Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ConstraintSchema.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ConstraintSchema.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ConstraintSchema.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,41 @@ +// +// Schema/ConstraintSchema.cs +// +// Authors: +// Christian Hergert +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + +namespace Mono.Data.Sql +{ + public class ConstraintSchema : AbstractSchema + { + public ColumnSchema[] Columns { + get { + return (ColumnSchema[]) null; + } + } + } +} \ No newline at end of file Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/DataTypeSchema.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/DataTypeSchema.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/DataTypeSchema.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,64 @@ +// +// Schema/DataTypeSchema.cs +// +// Authors: +// Christian Hergert +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + +namespace Mono.Data.Sql +{ + public class DataTypeSchema : AbstractSchema + { + protected bool isComplex = false; + + public DataTypeSchema (string name, bool isComplex) + { + this.isComplex = isComplex; + this.name = name; + } + + public bool IsComplex { + get { + return isComplex; + } + set { + isComplex = value; + OnChanged(); + } + } + + public ColumnSchema [] Columns { + get { + if (isComplex == false) { + return new ColumnSchema[0]; + } else { + // TODO: Get complex columns from the provider + throw new NotImplementedException(); + } + } + } + } +} \ No newline at end of file Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ForeignKeyConstraintSchema.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ForeignKeyConstraintSchema.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ForeignKeyConstraintSchema.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,53 @@ +// +// Schema/ForeignKeyConstraintSchema.cs +// +// Authors: +// Christian Hergert +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + +namespace Mono.Data.Sql +{ + public class ForeignKeyConstraintSchema : ConstraintSchema + { + protected string referenceTable = String.Empty; + + public TableSchema ReferenceTable { + get { + throw new NotImplementedException(); + } + set { + referenceTable = value.FullName; + OnChanged(); + } + } + + public ColumnSchema[] ReferenceColumns { + get { + return (ColumnSchema[]) null; + } + } + } +} \ No newline at end of file Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/GroupSchema.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/GroupSchema.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/GroupSchema.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,47 @@ +// +// Schema/ParameterSchema.cs +// +// Authors: +// Christian Hergert +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + +namespace Mono.Data.Sql +{ + public class GroupSchema : AbstractSchema + { + public UserSchema Users { + get { + throw new NotImplementedException (); + } + } + + public RoleSchema[] Roles { + get { + throw new NotImplementedException (); + } + } + } +} Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ISchema.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ISchema.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ISchema.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,96 @@ +// +// Schema/ISchema.cs +// +// Authors: +// Christian Hergert +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + +namespace Mono.Data.Sql +{ + public interface ISchema + { + /// + /// Event fired when the object is changed. + /// + event EventHandler Changed; + + /// + /// SQL object name. + /// + string Name { get; set; } + + /// + /// Full name of the object. This is typically `schema.objectname'. + /// + string FullName { get; } + + /// + /// SQL Comment associated with this object. + /// + string Comment { get; set; } + + /// + /// SQL Syntax Definition of this object. + /// + string Definition { get; set; } + + /// + /// Name of schema + /// + string SchemaName { get; set; } + + /// + /// Schema object representing the schema this object is part of. + /// + SchemaSchema Schema { get; set; } + + /// + /// Set the owners name in the database by the literal string name + /// of the user. + /// + string OwnerName { get; set; } + + /// + /// Owner of this sql object. + /// + UserSchema Owner { get; } + + /// + /// Privileges (sometimes known as ACL's) associated with this object. + /// + PrivilegeSchema [] Privileges { get; } + + /// + /// The connection provider associated with this SQL object. + /// + DbProviderBase Provider { get; set; } + + /// + /// Refresh the object from the database. + /// + void Refresh(); + } +} Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/IndexConstraintSchema.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/IndexConstraintSchema.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/IndexConstraintSchema.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,36 @@ +// +// Schema/IndexConstraintSchema.cs +// +// Authors: +// Christian Hergert +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + +namespace Mono.Data.Sql +{ + public class IndexConstraintSchema : ConstraintSchema + { + } +} \ No newline at end of file Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/LanguageSchema.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/LanguageSchema.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/LanguageSchema.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,47 @@ +// +// Schema/PrimaryKeyConstraintSchema.cs +// +// Authors: +// Christian Hergert +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + +namespace Mono.Data.Sql +{ + public class LanguageSchema : AbstractSchema + { + protected string handler = String.Empty; + + public ProcedureSchema Handler { + get { + // TODO: Get procedure + throw new NotImplementedException(); + } + set { + handler = value.FullName; + } + } + } +} \ No newline at end of file Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/OperatorSchema.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/OperatorSchema.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/OperatorSchema.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,56 @@ +// +// Schema/OperatorSchema.cs +// +// Authors: +// Christian Hergert +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + +namespace Mono.Data.Sql +{ + public class OperatorSchema : AbstractSchema + { + protected string leftDataType = String.Empty; + protected string rightDataType = String.Empty; + + public override string Name { + get { + return name; + } + } + + public DataTypeSchema LeftDataType { + get { + throw new NotImplementedException(); + } + set { + if (value != null) + leftDataType = value.Name; + else + leftDataType = String.Empty; + } + } + } +} \ No newline at end of file Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ParameterSchema.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ParameterSchema.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/ParameterSchema.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,46 @@ +// +// Schema/ParameterSchema.cs +// +// Authors: +// Christian Hergert +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + +namespace Mono.Data.Sql +{ + public class ParameterSchema : AbstractSchema + { + protected string dataType = String.Empty; + + public DataTypeSchema DataType { + get { + throw new NotImplementedException(); + } + set { + dataType = value.FullName; + } + } + } +} \ No newline at end of file Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/PrimaryKeyConstraintSchema.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/PrimaryKeyConstraintSchema.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/PrimaryKeyConstraintSchema.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,36 @@ +// +// Schema/PrimaryKeyConstraintSchema.cs +// +// Authors: +// Christian Hergert +// +// Copyright (C) 2005 Mosaix Communications, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + +namespace Mono.Data.Sql +{ + public class PrimaryKeyConstraintSchema : ConstraintSchema + { + } +} \ No newline at end of file Added: trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/PrivilegeSchema.cs =================================================================== --- trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/PrivilegeSchema.cs 2005-08-01 19:10:24 UTC (rev 2700) +++ trunk/MonoDevelop/Extras/MonoQuery/Mono.Data.Sql/Schema/PrivilegeSchema.cs 2005-08-02 20:35:00 UTC (rev 2701) @@ -0,0 +1,47 @@ +// +// Schema/PrivilegeSchema.cs +// +// A