bun-query-builder 0.2.13 → 0.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/cli.js CHANGED
@@ -28419,7 +28419,7 @@ function detectTypeFromValidationRule(rule) {
28419
28419
  case "string":
28420
28420
  case "text": {
28421
28421
  const maxValue = extractMaxFromRules(ruleObj);
28422
- return maxValue && maxValue > 255 ? "text" : "string";
28422
+ return maxValue && maxValue > MAX_BOUNDED_VARCHAR_LENGTH ? "text" : "string";
28423
28423
  }
28424
28424
  case "integer":
28425
28425
  case "int":
@@ -28569,7 +28569,7 @@ function buildMigrationPlan2(models, options) {
28569
28569
  inferred = normalizeAttributeType(attr.type) ?? detectTypeFromValidationRule(attr.validation?.rule);
28570
28570
  if (inferred === "string") {
28571
28571
  const maxLength = extractMaxFromRules(attr.validation?.rule);
28572
- if (maxLength && maxLength > 255)
28572
+ if (maxLength && maxLength > MAX_BOUNDED_VARCHAR_LENGTH)
28573
28573
  inferred = "text";
28574
28574
  }
28575
28575
  if (!inferred || inferred === "enum") {
@@ -28608,7 +28608,7 @@ function buildMigrationPlan2(models, options) {
28608
28608
  hasDefault: typeof attr.default !== "undefined",
28609
28609
  defaultValue: normalizeDefaultValue(attr.default),
28610
28610
  enumValues,
28611
- maxLength: typeof maxLen === "number" && maxLen > 0 && maxLen <= 255 ? maxLen : undefined
28611
+ maxLength: typeof maxLen === "number" && maxLen > 0 && maxLen <= MAX_BOUNDED_VARCHAR_LENGTH ? maxLen : undefined
28612
28612
  };
28613
28613
  if (columnName.endsWith("_id") && attr.foreignKey !== false && !polymorphicColumns.has(columnName)) {
28614
28614
  if (typeof attr.foreignKey === "object" && attr.foreignKey !== null) {
@@ -29453,7 +29453,7 @@ function generateDiffOperations(previous, next, opts = {}) {
29453
29453
  function generateDiffSql(previous, next, opts = {}) {
29454
29454
  return generateDiffOperations(previous, next, opts).statements;
29455
29455
  }
29456
- var migrationCounter = 0, migrationsCreatedCount = 0, migrationsUpdatedCount = 0, useDeterministicNames = true, createdMigrationFiles, existingCorpusBodies = null, GENERATED_MARKER = "-- qb:generated";
29456
+ var migrationCounter = 0, migrationsCreatedCount = 0, migrationsUpdatedCount = 0, useDeterministicNames = true, createdMigrationFiles, existingCorpusBodies = null, GENERATED_MARKER = "-- qb:generated", MAX_BOUNDED_VARCHAR_LENGTH = 767;
29457
29457
  var init_migrations = __esm(() => {
29458
29458
  init_config();
29459
29459
  init_drivers();
@@ -31542,7 +31542,7 @@ function getPrefix() {
31542
31542
  }
31543
31543
  var prefix = getPrefix();
31544
31544
  // package.json
31545
- var version2 = "0.2.13";
31545
+ var version2 = "0.2.14";
31546
31546
 
31547
31547
  // bin/cli.ts
31548
31548
  init_actions();
package/dist/src/index.js CHANGED
@@ -28418,7 +28418,7 @@ function detectTypeFromValidationRule(rule) {
28418
28418
  case "string":
28419
28419
  case "text": {
28420
28420
  const maxValue = extractMaxFromRules(ruleObj);
28421
- return maxValue && maxValue > 255 ? "text" : "string";
28421
+ return maxValue && maxValue > MAX_BOUNDED_VARCHAR_LENGTH ? "text" : "string";
28422
28422
  }
28423
28423
  case "integer":
28424
28424
  case "int":
@@ -28568,7 +28568,7 @@ function buildMigrationPlan2(models, options) {
28568
28568
  inferred = normalizeAttributeType(attr.type) ?? detectTypeFromValidationRule(attr.validation?.rule);
28569
28569
  if (inferred === "string") {
28570
28570
  const maxLength = extractMaxFromRules(attr.validation?.rule);
28571
- if (maxLength && maxLength > 255)
28571
+ if (maxLength && maxLength > MAX_BOUNDED_VARCHAR_LENGTH)
28572
28572
  inferred = "text";
28573
28573
  }
28574
28574
  if (!inferred || inferred === "enum") {
@@ -28607,7 +28607,7 @@ function buildMigrationPlan2(models, options) {
28607
28607
  hasDefault: typeof attr.default !== "undefined",
28608
28608
  defaultValue: normalizeDefaultValue(attr.default),
28609
28609
  enumValues,
28610
- maxLength: typeof maxLen === "number" && maxLen > 0 && maxLen <= 255 ? maxLen : undefined
28610
+ maxLength: typeof maxLen === "number" && maxLen > 0 && maxLen <= MAX_BOUNDED_VARCHAR_LENGTH ? maxLen : undefined
28611
28611
  };
28612
28612
  if (columnName.endsWith("_id") && attr.foreignKey !== false && !polymorphicColumns.has(columnName)) {
28613
28613
  if (typeof attr.foreignKey === "object" && attr.foreignKey !== null) {
@@ -29452,7 +29452,7 @@ function generateDiffOperations(previous, next, opts = {}) {
29452
29452
  function generateDiffSql(previous, next, opts = {}) {
29453
29453
  return generateDiffOperations(previous, next, opts).statements;
29454
29454
  }
29455
- var migrationCounter = 0, migrationsCreatedCount = 0, migrationsUpdatedCount = 0, useDeterministicNames = true, createdMigrationFiles, existingCorpusBodies = null, GENERATED_MARKER = "-- qb:generated";
29455
+ var migrationCounter = 0, migrationsCreatedCount = 0, migrationsUpdatedCount = 0, useDeterministicNames = true, createdMigrationFiles, existingCorpusBodies = null, GENERATED_MARKER = "-- qb:generated", MAX_BOUNDED_VARCHAR_LENGTH = 767;
29456
29456
  var init_migrations = __esm(() => {
29457
29457
  init_config();
29458
29458
  init_drivers();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-query-builder",
3
3
  "type": "module",
4
- "version": "0.2.13",
4
+ "version": "0.2.14",
5
5
  "description": "A simple yet performant query builder for TypeScript. Built with Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",