relq 1.0.98 → 1.0.99

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.
@@ -731,7 +731,7 @@ function generateSequenceCode(seq, useCamelCase) {
731
731
  if (seq.cycle)
732
732
  opts.push(`cycle: true`);
733
733
  if (seq.ownedBy)
734
- opts.push(`ownedBy: { table: '${seq.ownedBy.table}', column: '${seq.ownedBy.column}' }`);
734
+ opts.push(`ownedBy: '${seq.ownedBy.table}.${seq.ownedBy.column}'`);
735
735
  const trackingId = seq.trackingId || generateTrackingId('s');
736
736
  opts.push(`trackingId: '${trackingId}'`);
737
737
  const optsStr = opts.length > 0 ? `, { ${opts.join(', ')} }` : '';
@@ -749,6 +749,16 @@ async function introspectedToParsedSchema(schema) {
749
749
  comment: t.comment,
750
750
  });
751
751
  }
752
+ const isInternal = (name) => name.startsWith('_relq_') || name.startsWith('__relq_');
753
+ parsed.tables = parsed.tables.filter(t => !isInternal(t.name));
754
+ parsed.sequences = parsed.sequences.filter(s => {
755
+ if (isInternal(s.name))
756
+ return false;
757
+ if (s.ownedBy && isInternal(s.ownedBy.table))
758
+ return false;
759
+ return true;
760
+ });
761
+ parsed.triggers = parsed.triggers.filter(t => !isInternal(t.table));
752
762
  return parsed;
753
763
  }
754
764
  function normalizeTypeName(dataType, udtName) {
@@ -722,7 +722,7 @@ function generateSequenceCode(seq, useCamelCase) {
722
722
  if (seq.cycle)
723
723
  opts.push(`cycle: true`);
724
724
  if (seq.ownedBy)
725
- opts.push(`ownedBy: { table: '${seq.ownedBy.table}', column: '${seq.ownedBy.column}' }`);
725
+ opts.push(`ownedBy: '${seq.ownedBy.table}.${seq.ownedBy.column}'`);
726
726
  const trackingId = seq.trackingId || generateTrackingId('s');
727
727
  opts.push(`trackingId: '${trackingId}'`);
728
728
  const optsStr = opts.length > 0 ? `, { ${opts.join(', ')} }` : '';
@@ -739,6 +739,16 @@ export async function introspectedToParsedSchema(schema) {
739
739
  comment: t.comment,
740
740
  });
741
741
  }
742
+ const isInternal = (name) => name.startsWith('_relq_') || name.startsWith('__relq_');
743
+ parsed.tables = parsed.tables.filter(t => !isInternal(t.name));
744
+ parsed.sequences = parsed.sequences.filter(s => {
745
+ if (isInternal(s.name))
746
+ return false;
747
+ if (s.ownedBy && isInternal(s.ownedBy.table))
748
+ return false;
749
+ return true;
750
+ });
751
+ parsed.triggers = parsed.triggers.filter(t => !isInternal(t.table));
742
752
  return parsed;
743
753
  }
744
754
  function normalizeTypeName(dataType, udtName) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relq",
3
- "version": "1.0.98",
3
+ "version": "1.0.99",
4
4
  "description": "The Fully-Typed PostgreSQL ORM for TypeScript",
5
5
  "author": "Olajide Mathew O. <olajide.mathew@yuniq.solutions>",
6
6
  "license": "MIT",