diff options
author | Lluis Sanchez <lluis@novell.com> | 2007-12-04 13:57:22 +0300 |
---|---|---|
committer | Lluis Sanchez <lluis@novell.com> | 2007-12-04 13:57:22 +0300 |
commit | d60f689f45a88295971c324518d0e05b774016ae (patch) | |
tree | 279d50e9aa1659b27b5e6efe974ae678460be4cc /extras/MonoDevelop.Database/MonoDevelop.Database.Sql.MySql/MySqlDbFactory.cs | |
parent | 3693ff8d3f9ad1ab442a0bf8042017129bede938 (diff) |
Directory reorganization
svn path=/branches/monodevelop/reorg/; revision=90647
Diffstat (limited to 'extras/MonoDevelop.Database/MonoDevelop.Database.Sql.MySql/MySqlDbFactory.cs')
-rw-r--r-- | extras/MonoDevelop.Database/MonoDevelop.Database.Sql.MySql/MySqlDbFactory.cs | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.MySql/MySqlDbFactory.cs b/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.MySql/MySqlDbFactory.cs new file mode 100644 index 0000000000..e2dd5d0838 --- /dev/null +++ b/extras/MonoDevelop.Database/MonoDevelop.Database.Sql.MySql/MySqlDbFactory.cs @@ -0,0 +1,95 @@ +// +// Authors: +// Ben Motmans <ben.motmans@gmail.com> +//
+// Copyright (c) 2007 Ben Motmans
+//
+// 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.Data;
+using System.Collections.Generic; +using MonoDevelop.Core; +using MonoDevelop.Core.Gui; +using MonoDevelop.Database.Components;
+
+namespace MonoDevelop.Database.Sql
+{
+ public class MySqlDbFactory : AbstractDbFactory
+ { + private ISqlDialect dialect; + private IConnectionProvider connectionProvider; + private IGuiProvider guiProvider; + + public override string Identifier { + get { return "MySql.Data.MySqlClient"; } + } +
+ public override string Name { + get { return "MySql database"; } + } + + public override ISqlDialect Dialect { + get { + if (dialect == null) + dialect = new MySqlDialect (); + return dialect; + } + } + + public override IConnectionProvider ConnectionProvider { + get { + if (connectionProvider == null) + connectionProvider = new MySqlConnectionProvider (); + return connectionProvider; + } + } + + public override IGuiProvider GuiProvider { + get { + if (guiProvider == null) + guiProvider = new MySqlGuiProvider (); + return guiProvider; + } + } + + public override IConnectionPool CreateConnectionPool (DatabaseConnectionContext context) + { + return new DefaultConnectionPool (this, ConnectionProvider, context); + } + + public override ISchemaProvider CreateSchemaProvider (IConnectionPool connectionPool) + { + return new MySqlSchemaProvider (connectionPool); + } + + public override DatabaseConnectionSettings GetDefaultConnectionSettings () + { + DatabaseConnectionSettings settings = new DatabaseConnectionSettings (); + settings.ProviderIdentifier = Identifier; + settings.Server = "localhost"; + settings.Port = 3306; + settings.Username = "root"; + settings.MaxPoolSize = 5; + + return settings; + }
+ }
+}
\ No newline at end of file |