Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

21 wiersze
597 B

  1. module.exports = {
  2. exists: async function(value, options) {
  3. if (!value) return true;
  4. const db = this.getDbConnection(options.connection);
  5. const results = await db.from(options.table).where(options.column, value).limit(1);
  6. return results.length > 0;
  7. },
  8. notexists: async function(value, options) {
  9. if (!value) return true;
  10. const db = this.getDbConnection(options.connection);
  11. const results = await db.from(options.table).where(options.column, value).limit(1);
  12. return results.length == 0;
  13. }
  14. };