@mastra/mssql 0.5.1 → 0.5.2

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/index.js CHANGED
@@ -1860,6 +1860,20 @@ ${columns}
1860
1860
  return value ? 1 : 0;
1861
1861
  }
1862
1862
  if (columnSchema?.type === "jsonb") {
1863
+ if (typeof value === "string") {
1864
+ const trimmed = value.trim();
1865
+ if (trimmed.length > 0) {
1866
+ try {
1867
+ JSON.parse(trimmed);
1868
+ return trimmed;
1869
+ } catch {
1870
+ }
1871
+ }
1872
+ return JSON.stringify(value);
1873
+ }
1874
+ if (typeof value === "bigint") {
1875
+ return value.toString();
1876
+ }
1863
1877
  return JSON.stringify(value);
1864
1878
  }
1865
1879
  if (typeof value === "object") {