This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.database.model.DasTable | |
import com.intellij.database.util.Case | |
import com.intellij.database.util.DasUtil | |
/* | |
* Available context bindings: | |
* SELECTION Iterable<DasObject> | |
* PROJECT project | |
* FILES files helper | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _query = async (client, text, values) => { | |
const queryText = text.reduce((query, phrase, index)=>`${query} ${phrase}$${index+1}`, '') | |
const { rows } = await client.query(queryText, values) | |
return rows | |
} | |
const query = (stringArray, ...args) => { | |
const client = new Client() | |
const result = await _query(client, stringArray, args) |