Utility to perform soql queries from LWC
import { db } from 'c/bolt';
export default class myLwc extends LightningElement { @track Contacts; async handleClick() { this.Contacts = await db`SELECT Id, Name FROM Contact`; }}
export default class myLwc extends LightningElement { @track Contacts; @api recordId; async handleClick() { const SObjectApiName = 'Contact'; this.Contacts = await db`SELECT Id, Name FROM ${SObjectApiName} WHERE Id = ${this.recordId}`; }}
export default class myLwc extends LightningElement { @track Contacts; async handleClick() { const fields = ['Id', 'Name', 'foo__c','bar__c']; this.Contacts = await db`SELECT ${fields} FROM Contact`; }}