This repository was archived by the owner on Apr 29, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ files {
22
22
ui_page ' ui/build/index.html'
23
23
24
24
provide ' mysql-async'
25
+ provide ' ghmattimysql'
25
26
26
27
convar_category ' OxMySQL' {
27
28
' Configuration' ,
Original file line number Diff line number Diff line change @@ -78,6 +78,23 @@ MySQL.prepare = (
78
78
MySQL . execute = MySQL . query ;
79
79
MySQL . fetch = MySQL . query ;
80
80
81
+ function provide ( name : string , cb : Function , sync : Function ) {
82
+ on ( `__cfx_export_ghmattimysql_${ name } ` , ( setCb : Function ) => setCb ( cb ) ) ;
83
+ on ( `__cfx_export_ghmattimysql_${ name } Sync` , ( setCb : Function ) => setCb ( sync ) ) ;
84
+ }
85
+
86
+ // provide the "store" and "storeSync" exports, to provide compatibility for ghmattimysql
87
+ // these are not actually used to do anything, simply returning the query as-is
88
+ provide (
89
+ 'store' ,
90
+ ( query : string , cb : Function ) => {
91
+ cb ( query ) ;
92
+ } ,
93
+ ( query : string ) => {
94
+ return query ;
95
+ }
96
+ ) ;
97
+
81
98
for ( const key in MySQL ) {
82
99
global . exports ( key , MySQL [ key ] ) ;
83
100
@@ -98,4 +115,6 @@ for (const key in MySQL) {
98
115
99
116
global . exports ( `${ key } _async` , exp ) ;
100
117
global . exports ( `${ key } Sync` , exp ) ;
118
+
119
+ if ( key === 'execute' || key === 'scalar' || key === 'transaction' ) provide ( key , MySQL [ key ] , exp ) ;
101
120
}
You can’t perform that action at this time.
0 commit comments