Skip to content

Commit a051c23

Browse files
committed
restore query sql
1 parent 63e95d3 commit a051c23

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

Minio-SQL-connector/api/controllers/controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const logger = new Logger("controller")
66

77

88
const queryMongo = async (req, res) => {
9+
logger.info(req.body, req.query)
910
if (req.headers.israwquery)
1011
return await res.send(await service.rawQuery(req.query, req.body.prefix, req.body.bucketName, req.headers.visibility)) && logger.info("Raw query finished")
1112
logger.info("Query mongo")

Minio-SQL-connector/api/services/service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async function sync() {
4343
let index = 1
4444
for (let obj of bucketObjects) {
4545
try {
46-
await sleep(delays)
46+
//await sleep(delays)
4747
logger.debug("Bucket ", bucketIndex, " of ", buckets.length)
4848
logger.debug("Scanning object ", index++, " of ", bucketObjects.length, ",", obj.name)
4949
let extension = obj.name.split(".").pop()

Minio-SQL-connector/config.template.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports = {
2121
password: '',
2222
port: 5432
2323
},
24+
logLevel: "info",
2425
syncInterval : 86400000,
2526
doNotSyncAtStart : false,
2627
delays : 1,

Minio-SQL-connector/utils/common.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,10 @@ module.exports = {
278278
},
279279

280280
bodyCheck: async (req, res, next) => {
281-
if (req?.body?.mongoQuery && (
282-
Object.keys(req?.body?.mongoQuery).length == 1 && req.body.mongoQuery[''] == '' ||
283-
req.body.mongoQuery[''] == '{"$gte":null,"$lte":null}') || !req.body || !req.body.mongoQuery)
284-
req.body.mongoQuery = req.query
281+
if(req?.body?.mongoQuery && req.body.mongoQuery[''] == '{"$gte":null,"$lte":null}')
282+
delete req.body.mongoQuery['']
283+
if (!req.body.query && req?.body?.mongoQuery && !(Object.keys(req?.body?.mongoQuery).length == 1 && req.body.mongoQuery[''] == ''))
284+
//req.body ? req.body.mongoQuery = req.query : req.body = { mongoQuery: req.query }
285285
objectCheck([req.body.mongoQuery, req.query])
286286
next()
287287
}

Minio-SQL-connector/utils/minioWriter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ module.exports = {
428428

429429
async getObject(bucketName, objectName, format) {
430430

431-
log("Now getting object " + objectName + " in bucket " + bucketName)
431+
logger.trace("Now getting object " + objectName + " in bucket " + bucketName)
432432

433433
let resultMessage
434434
let errorMessage

0 commit comments

Comments
 (0)