/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@aalencarv/fullstack-orm@4.0.1/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import{firstValid,hasValue,isArray,typeOf}from"@aalencarv/common-utils";export const SqlAnsiOperator={equal:"=",notEqual:"<>",greaterThan:">",greaterEqualThan:">=",lessThan:"<",lessEqualThan:"<=",like:"like",notLike:"not like",in:"in",notIn:"not in",between:"between",notBetween:"not between",is:"is",isNot:"is not"};export const SqlAnsiLogicOperator={and:"and",or:"or"};export class BaseSqlComponent{constructor(e){hasValue(e)&&("string"==typeof e?this.expression=e:Object.assign(this,e))}}export class Column extends BaseSqlComponent{constructor(e){super(e),hasValue(e)&&(isArray(e)?(this.name=e[0],this.name=e[1]):"object"===typeOf(e)?Object.keys(e).indexOf("name")>-1?(this.name=e?.name,this.alias=e?.alias):this.name=e:["number"].indexOf(typeOf(e))>-1&&(this.name=e))}}export class Condition extends BaseSqlComponent{leftOperand;operator;rightOperand;constructor(e){super(e),hasValue(e)&&isArray(e)&&(this.leftOperand=e[0],this.operator=e[1],this.rightOperand=e[2])}}export class LogicExpression extends BaseSqlComponent{and;or;not;exists;notExists;constructor(e){super(e)}}export class FromTable extends BaseSqlComponent{constructor(e){super(e),hasValue(e)&&isArray(e)&&(this.table=e[0],this.alias=e[1])}}export class JoinTable extends FromTable{constructor(e){hasValue(e)&&(isArray(e)?(super(e[0]),this.join=e[1],this.on=e[2]):super(e))}}export class SelectQuery extends BaseSqlComponent{constructor(e){super(e)}}export class UnionQuery extends BaseSqlComponent{constructor(e){super(e),hasValue(e=e||{})&&"object"===typeOf(e)&&(e.all=firstValid([e.all,!0]))}}export class WithQuery extends BaseSqlComponent{constructor(e){super(e)}}
//# sourceMappingURL=/sm/6a6f2346c81ba41641150a82ed5309ad98e2607b66fe215802af857d6658e279.map