aboutsummaryrefslogtreecommitdiff
path: root/src/libs/dutil/WixToolset.DUtil/inc/sqlutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/inc/sqlutil.h')
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/sqlutil.h136
1 files changed, 136 insertions, 0 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/sqlutil.h b/src/libs/dutil/WixToolset.DUtil/inc/sqlutil.h
new file mode 100644
index 00000000..ddf09323
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/sqlutil.h
@@ -0,0 +1,136 @@
1#pragma once
2// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
3
4
5#include <cguid.h>
6#include <oledberr.h>
7#include <sqloledb.h>
8
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14// Adding this until the SQL annotations are published to specstrings.h
15#ifndef __sql_command
16#define __sql_command
17#endif
18
19// structs
20struct SQL_FILESPEC
21{
22 WCHAR wzName[MAX_PATH];
23 WCHAR wzFilename[MAX_PATH];
24 WCHAR wzSize[MAX_PATH];
25 WCHAR wzMaxSize[MAX_PATH];
26 WCHAR wzGrow[MAX_PATH];
27};
28
29
30// functions
31HRESULT DAPI SqlConnectDatabase(
32 __in_z LPCWSTR wzServer,
33 __in_z LPCWSTR wzInstance,
34 __in_z LPCWSTR wzDatabase,
35 __in BOOL fIntegratedAuth,
36 __in_z LPCWSTR wzUser,
37 __in_z LPCWSTR wzPassword,
38 __out IDBCreateSession** ppidbSession
39 );
40HRESULT DAPI SqlStartTransaction(
41 __in IDBCreateSession* pidbSession,
42 __out IDBCreateCommand** ppidbCommand,
43 __out ITransaction** ppit
44 );
45HRESULT DAPI SqlEndTransaction(
46 __in ITransaction* pit,
47 __in BOOL fCommit
48 );
49HRESULT DAPI SqlDatabaseExists(
50 __in_z LPCWSTR wzServer,
51 __in_z LPCWSTR wzInstance,
52 __in_z LPCWSTR wzDatabase,
53 __in BOOL fIntegratedAuth,
54 __in_z LPCWSTR wzUser,
55 __in_z LPCWSTR wzPassword,
56 __out_opt BSTR* pbstrErrorDescription
57 );
58HRESULT DAPI SqlSessionDatabaseExists(
59 __in IDBCreateSession* pidbSession,
60 __in_z LPCWSTR wzDatabase,
61 __out_opt BSTR* pbstrErrorDescription
62 );
63HRESULT DAPI SqlDatabaseEnsureExists(
64 __in_z LPCWSTR wzServer,
65 __in_z LPCWSTR wzInstance,
66 __in_z LPCWSTR wzDatabase,
67 __in BOOL fIntegratedAuth,
68 __in_z LPCWSTR wzUser,
69 __in_z LPCWSTR wzPassword,
70 __in_opt const SQL_FILESPEC* psfDatabase,
71 __in_opt const SQL_FILESPEC* psfLog,
72 __out_opt BSTR* pbstrErrorDescription
73 );
74HRESULT DAPI SqlSessionDatabaseEnsureExists(
75 __in IDBCreateSession* pidbSession,
76 __in_z LPCWSTR wzDatabase,
77 __in_opt const SQL_FILESPEC* psfDatabase,
78 __in_opt const SQL_FILESPEC* psfLog,
79 __out_opt BSTR* pbstrErrorDescription
80 );
81HRESULT DAPI SqlCreateDatabase(
82 __in_z LPCWSTR wzServer,
83 __in_z LPCWSTR wzInstance,
84 __in_z LPCWSTR wzDatabase,
85 __in BOOL fIntegratedAuth,
86 __in_z LPCWSTR wzUser,
87 __in_z LPCWSTR wzPassword,
88 __in_opt const SQL_FILESPEC* psfDatabase,
89 __in_opt const SQL_FILESPEC* psfLog,
90 __out_opt BSTR* pbstrErrorDescription
91 );
92HRESULT DAPI SqlSessionCreateDatabase(
93 __in IDBCreateSession* pidbSession,
94 __in_z LPCWSTR wzDatabase,
95 __in_opt const SQL_FILESPEC* psfDatabase,
96 __in_opt const SQL_FILESPEC* psfLog,
97 __out_opt BSTR* pbstrErrorDescription
98 );
99HRESULT DAPI SqlDropDatabase(
100 __in_z LPCWSTR wzServer,
101 __in_z LPCWSTR wzInstance,
102 __in_z LPCWSTR wzDatabase,
103 __in BOOL fIntegratedAuth,
104 __in_z LPCWSTR wzUser,
105 __in_z LPCWSTR wzPassword,
106 __out_opt BSTR* pbstrErrorDescription
107 );
108HRESULT DAPI SqlSessionDropDatabase(
109 __in IDBCreateSession* pidbSession,
110 __in_z LPCWSTR wzDatabase,
111 __out_opt BSTR* pbstrErrorDescription
112 );
113HRESULT DAPI SqlSessionExecuteQuery(
114 __in IDBCreateSession* pidbSession,
115 __in __sql_command LPCWSTR wzSql,
116 __out_opt IRowset** ppirs,
117 __out_opt DBROWCOUNT* pcRows,
118 __out_opt BSTR* pbstrErrorDescription
119 );
120HRESULT DAPI SqlCommandExecuteQuery(
121 __in IDBCreateCommand* pidbCommand,
122 __in __sql_command LPCWSTR wzSql,
123 __out IRowset** ppirs,
124 __out DBROWCOUNT* pcRows
125 );
126HRESULT DAPI SqlGetErrorInfo(
127 __in IUnknown* pObjectWithError,
128 __in REFIID IID_InterfaceWithError,
129 __in DWORD dwLocaleId,
130 __out_opt BSTR* pbstrErrorSource,
131 __out_opt BSTR* pbstrErrorDescription
132 );
133
134#ifdef __cplusplus
135}
136#endif