DeveelDB
20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
deveeldb.git
src
deveeldb
Deveel.Data.Client
DatabaseExtensions.cs
Go to the documentation of this file.
1
//
2
// Copyright 2010-2015 Deveel
3
//
4
// Licensed under the Apache License, Version 2.0 (the "License");
5
// you may not use this file except in compliance with the License.
6
// You may obtain a copy of the License at
7
//
8
// http://www.apache.org/licenses/LICENSE-2.0
9
//
10
// Unless required by applicable law or agreed to in writing, software
11
// distributed under the License is distributed on an "AS IS" BASIS,
12
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
// See the License for the specific language governing permissions and
14
// limitations under the License.
15
//
16
17
using
System
;
18
using
System
.Data;
19
20
using
Deveel
.
Data
;
21
using
Deveel
.
Data
.
Protocol
;
22
23
namespace
Deveel
.Data.Client {
24
public
static
class
DatabaseExtensions
{
25
public
static
IDbConnection
CreateDbConnection
(
this
IDatabase
database,
string
userName,
string
password) {
26
if
(database == null)
27
throw
new
ArgumentNullException(
"database"
);
28
29
var dbHandler = database.
Context
.
SystemContext
as
IDatabaseHandler
;
30
if
(dbHandler == null)
31
dbHandler =
new
SingleDatabaseHandler
(database);
32
33
var serverConnector =
new
EmbeddedServerConnector
(dbHandler);
34
var clientConnector =
new
EmbeddedClientConnector
(serverConnector);
35
36
var settings =
new
DeveelDbConnectionStringBuilder
{
37
UserName = userName,
38
Password = password,
39
Database
= database.
Name
40
};
41
42
return
new
DeveelDbConnection
(clientConnector, settings);
43
}
44
}
45
}
Deveel
System
Definition:
NonSerializedAttribute.cs:3
Deveel.Data.Client.DeveelDbConnection
Definition:
DeveelDbConnection.cs:28
Deveel.Data.Protocol.EmbeddedClientConnector
Definition:
EmbeddedClientConnector.cs:21
Deveel.Data.Client.DeveelDbConnectionStringBuilder
Definition:
DeveelDbConnectionStringBuilder.cs:28
Deveel.Data.Protocol
Definition:
LocalQueryResult.cs:24
Deveel.Data.Database
The default implementation of a database in a system.
Definition:
Database.cs:38
Deveel.Data.IDatabase.Name
string Name
Gets the name of the database.
Definition:
IDatabase.cs:44
Deveel.Data.IDatabase
The representation of a single database in the system.
Definition:
IDatabase.cs:40
Deveel.Data.IDatabase.Context
new IDatabaseContext Context
Gets the context that contains this database.
Definition:
IDatabase.cs:50
Deveel.Data.Client.DatabaseExtensions
Definition:
DatabaseExtensions.cs:24
Deveel.Data.Protocol.EmbeddedServerConnector
Definition:
EmbeddedServerConnector.cs:23
Deveel.Data
Definition:
ActiveSessionList.cs:22
Deveel.Data.Client.DatabaseExtensions.CreateDbConnection
static IDbConnection CreateDbConnection(this IDatabase database, string userName, string password)
Definition:
DatabaseExtensions.cs:25
Deveel.Data.SingleDatabaseHandler
Definition:
SingleDatabaseHandler.cs:20
Deveel.Data.IDatabaseHandler
Definition:
IDatabaseHandler.cs:20
Deveel.Data.IDatabaseContext.SystemContext
ISystemContext SystemContext
Gets the context of the database system that handles this database.
Definition:
IDatabaseContext.cs:40
Generated by
1.8.10