| | 1 | | /* |
| | 2 | | * Copyright 2017 Stanislav Muhametsin. All rights Reserved. |
| | 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 |
| | 13 | | * implied. |
| | 14 | | * |
| | 15 | | * See the License for the specific language governing permissions and |
| | 16 | | * limitations under the License. |
| | 17 | | */ |
| | 18 | | using CBAM.SQL.Implementation; |
| | 19 | | using CBAM.SQL.PostgreSQL; |
| | 20 | | using System; |
| | 21 | | using System.Collections.Generic; |
| | 22 | | using System.Text; |
| | 23 | |
|
| | 24 | | namespace CBAM.SQL.PostgreSQL.Implementation |
| | 25 | | { |
| | 26 | | internal sealed class PgSQLStatementBuilder : StatementBuilderImpl<StatementParameter> |
| | 27 | | { |
| | 28 | |
|
| | 29 | | public PgSQLStatementBuilder( |
| | 30 | | PgSQLStatementBuilderInformation information, |
| | 31 | | StatementParameter[] currentParameters, |
| | 32 | | List<StatementParameter[]> batchParams |
| | 33 | | ) |
| 60 | 34 | | : base( information, currentParameters, batchParams ) |
| | 35 | | { |
| 60 | 36 | | } |
| | 37 | |
|
| | 38 | | protected override StatementParameter CreateStatementParameter( Int32 parameterIndex, Object value, Type clrType ) |
| | 39 | | { |
| 49 | 40 | | return new StatementParameterImpl( |
| 49 | 41 | | clrType, |
| 49 | 42 | | value |
| 49 | 43 | | ); |
| | 44 | | } |
| | 45 | |
|
| | 46 | | //protected override SQLException VerifyBatchParameters( StatementParameter previous, StatementParameter toBeAdded |
| | 47 | | //{ |
| | 48 | | // return null; |
| | 49 | | //} |
| | 50 | | } |
| | 51 | |
|
| | 52 | | internal sealed class PgSQLStatementBuilderInformation : StatementBuilderInformationImpl<StatementParameter, List<Sta |
| | 53 | | { |
| | 54 | | public PgSQLStatementBuilderInformation( |
| | 55 | | String sql, |
| | 56 | | StatementParameter[] currentParameters, |
| | 57 | | List<StatementParameter[]> batchParams, |
| | 58 | | Int32[] parameterIndices |
| | 59 | | ) : base( sql, currentParameters, batchParams ) |
| | 60 | | { |
| | 61 | | this.ParameterIndices = parameterIndices; |
| | 62 | | } |
| | 63 | |
|
| | 64 | | internal Int32[] ParameterIndices { get; } |
| | 65 | | } |
| | 66 | |
|
| | 67 | |
|
| | 68 | | //internal sealed class PgSQLStatementParameterImpl : StatementParameterImpl, PgStatementParameter |
| | 69 | | //{ |
| | 70 | | // public PgSQLStatementParameterImpl( |
| | 71 | | // Type cilType, |
| | 72 | | // Object value, |
| | 73 | | // TypeRegistry typeRegistry |
| | 74 | | // ) : base( cilType, value ) |
| | 75 | | // { |
| | 76 | | // this.DBTypeID = typeRegistry.GetTypeInfo( cilType ).BoundData.TypeID; |
| | 77 | | // } |
| | 78 | |
|
| | 79 | | // public Int32 DBTypeID { get; } |
| | 80 | | //} |
| | 81 | | } |