Skip to content

Commit d89d308

Browse files
author
Theekshna Kotian
committed
Merged PR 5313: DDBC bindings code cleanup + Logging & error handling
DDBC bindings code cleanup + Logging & error handling ---- #### AI description (iteration 1) #### PR Classification Code cleanup and enhancement of logging and error handling. #### PR Summary This pull request focuses on cleaning up the DDBC bindings code, improving logging, and enhancing error handling. - `.clang-format`: Simplified the configuration by removing numerous formatting rules. - `mssql_python/pybind/ddbc_bindings.cpp`: Refactored parameter binding logic, added detailed logging, and improved error handling by introducing `LoadDriverOrThrowException` and `GetSqlCTypeAsString` functions. - Enhanced the `AllocateParamBuffer` function to support constructor arguments and improved error messages for parameter type mismatches. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #33807
1 parent 24aec4c commit d89d308

2 files changed

Lines changed: 370 additions & 670 deletions

File tree

.clang-format

Lines changed: 1 addition & 304 deletions
Original file line numberDiff line numberDiff line change
@@ -1,309 +1,6 @@
11
---
22
Language: Cpp
33
BasedOnStyle: Google
4-
AccessModifierOffset: -1
5-
AlignAfterOpenBracket: Align
6-
AlignArrayOfStructures: None
7-
AlignConsecutiveAssignments:
8-
Enabled: false
9-
AcrossEmptyLines: false
10-
AcrossComments: false
11-
AlignCompound: false
12-
AlignFunctionPointers: false
13-
PadOperators: true
14-
AlignConsecutiveBitFields:
15-
Enabled: false
16-
AcrossEmptyLines: false
17-
AcrossComments: false
18-
AlignCompound: false
19-
AlignFunctionPointers: false
20-
PadOperators: false
21-
AlignConsecutiveDeclarations:
22-
Enabled: false
23-
AcrossEmptyLines: false
24-
AcrossComments: false
25-
AlignCompound: false
26-
AlignFunctionPointers: false
27-
PadOperators: false
28-
AlignConsecutiveMacros:
29-
Enabled: false
30-
AcrossEmptyLines: false
31-
AcrossComments: false
32-
AlignCompound: false
33-
AlignFunctionPointers: false
34-
PadOperators: false
35-
AlignConsecutiveShortCaseStatements:
36-
Enabled: false
37-
AcrossEmptyLines: false
38-
AcrossComments: false
39-
AlignCaseArrows: false
40-
AlignCaseColons: false
41-
AlignConsecutiveTableGenBreakingDAGArgColons:
42-
Enabled: false
43-
AcrossEmptyLines: false
44-
AcrossComments: false
45-
AlignCompound: false
46-
AlignFunctionPointers: false
47-
PadOperators: false
48-
AlignConsecutiveTableGenCondOperatorColons:
49-
Enabled: false
50-
AcrossEmptyLines: false
51-
AcrossComments: false
52-
AlignCompound: false
53-
AlignFunctionPointers: false
54-
PadOperators: false
55-
AlignConsecutiveTableGenDefinitionColons:
56-
Enabled: false
57-
AcrossEmptyLines: false
58-
AcrossComments: false
59-
AlignCompound: false
60-
AlignFunctionPointers: false
61-
PadOperators: false
62-
AlignEscapedNewlines: Left
63-
AlignOperands: Align
64-
AlignTrailingComments:
65-
Kind: Always
66-
OverEmptyLines: 0
67-
AllowAllArgumentsOnNextLine: true
68-
AllowAllParametersOfDeclarationOnNextLine: true
69-
AllowBreakBeforeNoexceptSpecifier: Never
70-
AllowShortBlocksOnASingleLine: Never
71-
AllowShortCaseExpressionOnASingleLine: true
72-
AllowShortCaseLabelsOnASingleLine: false
73-
AllowShortCompoundRequirementOnASingleLine: true
74-
AllowShortEnumsOnASingleLine: true
75-
AllowShortFunctionsOnASingleLine: All
76-
AllowShortIfStatementsOnASingleLine: WithoutElse
77-
AllowShortLambdasOnASingleLine: All
78-
AllowShortLoopsOnASingleLine: true
79-
AlwaysBreakAfterDefinitionReturnType: None
80-
AlwaysBreakBeforeMultilineStrings: true
81-
AttributeMacros:
82-
- __capability
83-
BinPackArguments: true
84-
BinPackParameters: true
85-
BitFieldColonSpacing: Both
86-
BraceWrapping:
87-
AfterCaseLabel: false
88-
AfterClass: false
89-
AfterControlStatement: Never
90-
AfterEnum: false
91-
AfterExternBlock: false
92-
AfterFunction: false
93-
AfterNamespace: false
94-
AfterObjCDeclaration: false
95-
AfterStruct: false
96-
AfterUnion: false
97-
BeforeCatch: false
98-
BeforeElse: false
99-
BeforeLambdaBody: false
100-
BeforeWhile: false
101-
IndentBraces: false
102-
SplitEmptyFunction: true
103-
SplitEmptyRecord: true
104-
SplitEmptyNamespace: true
105-
BreakAdjacentStringLiterals: true
106-
BreakAfterAttributes: Leave
107-
BreakAfterJavaFieldAnnotations: false
108-
BreakAfterReturnType: None
109-
BreakArrays: true
110-
BreakBeforeBinaryOperators: None
111-
BreakBeforeConceptDeclarations: Always
112-
BreakBeforeBraces: Attach
113-
BreakBeforeInlineASMColon: OnlyMultiline
114-
BreakBeforeTernaryOperators: true
115-
BreakConstructorInitializers: BeforeColon
116-
BreakFunctionDefinitionParameters: false
117-
BreakInheritanceList: BeforeColon
118-
BreakStringLiterals: true
119-
BreakTemplateDeclarations: Yes
1204
ColumnLimit: 100
121-
CommentPragmas: '^ IWYU pragma:'
122-
CompactNamespaces: false
123-
ConstructorInitializerIndentWidth: 4
124-
ContinuationIndentWidth: 4
125-
Cpp11BracedListStyle: true
126-
DerivePointerAlignment: true
127-
DisableFormat: false
128-
EmptyLineAfterAccessModifier: Never
129-
EmptyLineBeforeAccessModifier: LogicalBlock
130-
ExperimentalAutoDetectBinPacking: false
131-
FixNamespaceComments: true
132-
ForEachMacros:
133-
- foreach
134-
- Q_FOREACH
135-
- BOOST_FOREACH
136-
IfMacros:
137-
- KJ_IF_MAYBE
138-
IncludeBlocks: Regroup
139-
IncludeCategories:
140-
- Regex: '^<ext/.*\.h>'
141-
Priority: 2
142-
SortPriority: 0
143-
CaseSensitive: false
144-
- Regex: '^<.*\.h>'
145-
Priority: 1
146-
SortPriority: 0
147-
CaseSensitive: false
148-
- Regex: '^<.*'
149-
Priority: 2
150-
SortPriority: 0
151-
CaseSensitive: false
152-
- Regex: '.*'
153-
Priority: 3
154-
SortPriority: 0
155-
CaseSensitive: false
156-
IncludeIsMainRegex: '([-_](test|unittest))?$'
157-
IncludeIsMainSourceRegex: ''
158-
IndentAccessModifiers: false
159-
IndentCaseBlocks: false
160-
IndentCaseLabels: true
161-
IndentExternBlock: AfterExternBlock
162-
IndentGotoLabels: true
163-
IndentPPDirectives: None
164-
IndentRequiresClause: true
1655
IndentWidth: 4
166-
IndentWrappedFunctionNames: false
167-
InsertBraces: false
168-
InsertNewlineAtEOF: false
169-
InsertTrailingCommas: None
170-
IntegerLiteralSeparator:
171-
Binary: 0
172-
BinaryMinDigits: 0
173-
Decimal: 0
174-
DecimalMinDigits: 0
175-
Hex: 0
176-
HexMinDigits: 0
177-
JavaScriptQuotes: Leave
178-
JavaScriptWrapImports: true
179-
KeepEmptyLines:
180-
AtEndOfFile: false
181-
AtStartOfBlock: false
182-
AtStartOfFile: true
183-
LambdaBodyIndentation: Signature
184-
LineEnding: DeriveLF
185-
MacroBlockBegin: ''
186-
MacroBlockEnd: ''
187-
MainIncludeChar: Quote
188-
MaxEmptyLinesToKeep: 1
189-
NamespaceIndentation: None
190-
ObjCBinPackProtocolList: Never
191-
ObjCBlockIndentWidth: 2
192-
ObjCBreakBeforeNestedBlockParam: true
193-
ObjCSpaceAfterProperty: false
194-
ObjCSpaceBeforeProtocolList: true
195-
PackConstructorInitializers: NextLine
196-
PenaltyBreakAssignment: 2
197-
PenaltyBreakBeforeFirstCallParameter: 1
198-
PenaltyBreakComment: 300
199-
PenaltyBreakFirstLessLess: 120
200-
PenaltyBreakOpenParenthesis: 0
201-
PenaltyBreakScopeResolution: 500
202-
PenaltyBreakString: 1000
203-
PenaltyBreakTemplateDeclaration: 10
204-
PenaltyExcessCharacter: 1000000
205-
PenaltyIndentedWhitespace: 0
206-
PenaltyReturnTypeOnItsOwnLine: 200
207-
PointerAlignment: Left
208-
PPIndentWidth: -1
209-
QualifierAlignment: Leave
210-
RawStringFormats:
211-
- Language: Cpp
212-
Delimiters:
213-
- cc
214-
- CC
215-
- cpp
216-
- Cpp
217-
- CPP
218-
- 'c++'
219-
- 'C++'
220-
CanonicalDelimiter: ''
221-
BasedOnStyle: google
222-
- Language: TextProto
223-
Delimiters:
224-
- pb
225-
- PB
226-
- proto
227-
- PROTO
228-
EnclosingFunctions:
229-
- EqualsProto
230-
- EquivToProto
231-
- PARSE_PARTIAL_TEXT_PROTO
232-
- PARSE_TEST_PROTO
233-
- PARSE_TEXT_PROTO
234-
- ParseTextOrDie
235-
- ParseTextProtoOrDie
236-
- ParseTestProto
237-
- ParsePartialTestProto
238-
CanonicalDelimiter: pb
239-
BasedOnStyle: google
240-
ReferenceAlignment: Pointer
241-
ReflowComments: true
242-
RemoveBracesLLVM: false
243-
RemoveParentheses: Leave
244-
RemoveSemicolon: false
245-
RequiresClausePosition: OwnLine
246-
RequiresExpressionIndentation: OuterScope
247-
SeparateDefinitionBlocks: Leave
248-
ShortNamespaceLines: 1
249-
SkipMacroDefinitionBody: false
250-
SortIncludes: CaseSensitive
251-
SortJavaStaticImport: Before
252-
SortUsingDeclarations: LexicographicNumeric
253-
SpaceAfterCStyleCast: false
254-
SpaceAfterLogicalNot: false
255-
SpaceAfterTemplateKeyword: true
256-
SpaceAroundPointerQualifiers: Default
257-
SpaceBeforeAssignmentOperators: true
258-
SpaceBeforeCaseColon: false
259-
SpaceBeforeCpp11BracedList: false
260-
SpaceBeforeCtorInitializerColon: true
261-
SpaceBeforeInheritanceColon: true
262-
SpaceBeforeJsonColon: false
263-
SpaceBeforeParens: ControlStatements
264-
SpaceBeforeParensOptions:
265-
AfterControlStatements: true
266-
AfterForeachMacros: true
267-
AfterFunctionDefinitionName: false
268-
AfterFunctionDeclarationName: false
269-
AfterIfMacros: true
270-
AfterOverloadedOperator: false
271-
AfterPlacementOperator: true
272-
AfterRequiresInClause: false
273-
AfterRequiresInExpression: false
274-
BeforeNonEmptyParentheses: false
275-
SpaceBeforeRangeBasedForLoopColon: true
276-
SpaceBeforeSquareBrackets: false
277-
SpaceInEmptyBlock: false
278-
SpacesBeforeTrailingComments: 2
279-
SpacesInAngles: Never
280-
SpacesInContainerLiterals: true
281-
SpacesInLineCommentPrefix:
282-
Minimum: 1
283-
Maximum: -1
284-
SpacesInParens: Never
285-
SpacesInParensOptions:
286-
ExceptDoubleParentheses: false
287-
InCStyleCasts: false
288-
InConditionalStatements: false
289-
InEmptyParentheses: false
290-
Other: false
291-
SpacesInSquareBrackets: false
292-
Standard: Auto
293-
StatementAttributeLikeMacros:
294-
- Q_EMIT
295-
StatementMacros:
296-
- Q_UNUSED
297-
- QT_REQUIRE_VERSION
298-
TableGenBreakInsideDAGArg: DontBreak
299-
TabWidth: 8
300-
UseTab: Never
301-
VerilogBreakBetweenInstancePorts: true
302-
WhitespaceSensitiveMacros:
303-
- BOOST_PP_STRINGIZE
304-
- CF_SWIFT_NAME
305-
- NS_SWIFT_NAME
306-
- PP_STRINGIZE
307-
- STRINGIZE
308-
...
309-
6+
TabWidth: 4

0 commit comments

Comments
 (0)