René's URL Explorer Experiment


Title: fix(tables): type-aware SQL casts for range filters on date columns by waleedlatif1 · Pull Request #4657 · simstudioai/sim · GitHub

Open Graph Title: fix(tables): type-aware SQL casts for range filters on date columns by waleedlatif1 · Pull Request #4657 · simstudioai/sim

X Title: fix(tables): type-aware SQL casts for range filters on date columns by waleedlatif1 · Pull Request #4657 · simstudioai/sim

Description: Summary buildComparisonClause now branches on column type via a shared jsonbCastForType helper: number → ::numeric, date → ::timestamp (with RHS cast so Postgres doesn't fall back to text comparison), unknown → ::numeric for back-compat columns is now required on buildFilterClause and buildSortClause so the cast can't be silently dropped at a call site queryRows / updateRowsByFilter / deleteRowsByFilter take table: TableDefinition as the first arg (symmetric); all call sites updated Restored defense-in-depth workspace guard in copilot tool paths where getTableById doesn't auth (query_rows, update_rows_by_filter, delete_rows_by_filter, function-execute, generate-visualization) New sql.test.ts suite asserts real generated SQL (numeric vs timestamp, range, nested $and/$or propagation, regression guards) Type of Change Bug fix Testing Tested manually. bun run test lib/table lib/copilot/tools/server/table (135 passing), bun run type-check, and bun run check:api-validation all clean. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary buildComparisonClause now branches on column type via a shared jsonbCastForType helper: number → ::numeric, date → ::timestamp (with RHS cast so Postgres doesn't fall back to text comp...

X Description: Summary buildComparisonClause now branches on column type via a shared jsonbCastForType helper: number → ::numeric, date → ::timestamp (with RHS cast so Postgres doesn't fall back to text ...

Opengraph URL: https://github.com/simstudioai/sim/pull/4657

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:ea7babf9-34f1-9bc1-d5b0-a6006adb3653
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBEA0:FBC06:11DE797:1891138:6AFB6EF3
html-safe-nonceb58c63add04cb6090674d14d5211716e89bf8cf7c54ab6acf114e623520c5821
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRUEwOkZCQzA2OjExREU3OTc6MTg5MTEzODo2QUZCNkVGMyIsInZpc2l0b3JfaWQiOiI1OTYwMTE0NDkxOTc3NTkyNTYzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaca1c9a1efcc2ddf33913d61d6eb54d5f42531bbdb77d5839195ae28e2c344fd1a
hovercard-subject-tagpull_request:3705774847
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/4657/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary buildComparisonClause now branches on column type via a shared jsonbCastForType helper: number → ::numeric, date → ::timestamp (with RHS cast so Postgres doesn't fall back to text comp...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0e29e7974fdda2feeaf5c891efd4b23b0734b23480232b62c7bdef13f40b5b48
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2e8872b770cc4d5d0cc1f2026afab747a268e2ce
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/4657/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F4657%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F4657%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/4657/files
Reloadhttps://github.com/simstudioai/sim/pull/4657/files
Reloadhttps://github.com/simstudioai/sim/pull/4657/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests198 (198)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
waleedlatif1/review-pr-4649https://github.com/simstudioai/sim/tree/waleedlatif1/review-pr-4649
Conversation 9 https://github.com/simstudioai/sim/pull/4657
Commits 5 https://github.com/simstudioai/sim/pull/4657/commits
Checks 13 https://github.com/simstudioai/sim/pull/4657/checks
Files changed https://github.com/simstudioai/sim/pull/4657/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4657/files
fix(tables): type-aware SQL casts for range filters on date columns https://github.com/simstudioai/sim/pull/4657/files#top
Show all changes 5 commits https://github.com/simstudioai/sim/pull/4657/files
0af4891 fix(tables): type-aware SQL casts for range filters on date columns waleedlatif1 May 19, 2026 https://github.com/simstudioai/sim/pull/4657/commits/0af489143529333a7b027498b01ce1c69d786ff7
a0da8e2 improvement(table): tighten filter-cast types & workspace guards waleedlatif1 May 19, 2026 https://github.com/simstudioai/sim/pull/4657/commits/a0da8e2b0f7e38158761183efd0895cc5e3b634d
8503120 improvement(table): cast jsonb date filters/sorts to timestamptz waleedlatif1 May 19, 2026 https://github.com/simstudioai/sim/pull/4657/commits/850312053bc73355fe084437e801c03fb38ca721
abbdaa1 improvement(table): correct JSDoc examples for required columns arg waleedlatif1 May 19, 2026 https://github.com/simstudioai/sim/pull/4657/commits/abbdaa177474b73a464d550f2c5e1ec13e07446a
6a87e6e improvement(table): validate range operator value types at SQL builder waleedlatif1 May 19, 2026 https://github.com/simstudioai/sim/pull/4657/commits/6a87e6e5f1b07e4e0ed552718b860cfa2a90d3a6
Clear filters https://github.com/simstudioai/sim/pull/4657/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4657/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4657/files
route.ts https://github.com/simstudioai/sim/pull/4657/files#diff-7dca5a7f6d60b5808a948942a7193b2820ee38e61436607616eb7e6329958980
route.ts https://github.com/simstudioai/sim/pull/4657/files#diff-1d524d6cc0249dc92450d77e6a2572ddeebca5658f48b15a06026fefe7c8713e
route.ts https://github.com/simstudioai/sim/pull/4657/files#diff-66da8dda9c2be82f25e925ab86c5165605398d122a0aa192cd7665b2819bb067
function-execute.ts https://github.com/simstudioai/sim/pull/4657/files#diff-e6d4d4c49c334453d57aa77c7e31d792717e1d0c94b39df8d6021b98a561c91c
user-table.ts https://github.com/simstudioai/sim/pull/4657/files#diff-f226f84ebf59d60c85e117fec4b44d258fed6a0a424dc27695e921ceee6a1d41
generate-visualization.ts https://github.com/simstudioai/sim/pull/4657/files#diff-77c01651e0c8b3592fed25603660f1c71324a878afbb356d666c32cf89f2eaa7
service-filter-threading.test.ts https://github.com/simstudioai/sim/pull/4657/files#diff-fc16d1af6c583a6c382bb94c9e7945067cee0fb6c9c9c4298546d78f09dfbaaa
sql.test.ts https://github.com/simstudioai/sim/pull/4657/files#diff-3fe61c7ca54977c5c4da074803b43fe6e2f81216aedc0e941bbf887daf3a64ed
service.ts https://github.com/simstudioai/sim/pull/4657/files#diff-691e9b1dc59be0015a1be5ea6189899b241d4e979a8b40e088dd7d722cfaadb6
sql.ts https://github.com/simstudioai/sim/pull/4657/files#diff-6bdc8e3314777d023d081101b83c0458072aef721da07cf8b8881fd5d0fab5b3
types.ts https://github.com/simstudioai/sim/pull/4657/files#diff-d1e7779b43ae63cc518e46dc1391df909007ee5cd0f9ee4c920688b1111e2cf1
apps/sim/app/api/table/[tableId]/export/route.tshttps://github.com/simstudioai/sim/pull/4657/files#diff-7dca5a7f6d60b5808a948942a7193b2820ee38e61436607616eb7e6329958980
View file https://github.com/simstudioai/sim/blob/6a87e6e5f1b07e4e0ed552718b860cfa2a90d3a6/apps/sim/app/api/table/%5BtableId%5D/export/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4657/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4657/files#diff-7dca5a7f6d60b5808a948942a7193b2820ee38e61436607616eb7e6329958980
https://github.com/simstudioai/sim/pull/4657/files#diff-7dca5a7f6d60b5808a948942a7193b2820ee38e61436607616eb7e6329958980
apps/sim/app/api/table/[tableId]/rows/route.tshttps://github.com/simstudioai/sim/pull/4657/files#diff-1d524d6cc0249dc92450d77e6a2572ddeebca5658f48b15a06026fefe7c8713e
View file https://github.com/simstudioai/sim/blob/6a87e6e5f1b07e4e0ed552718b860cfa2a90d3a6/apps/sim/app/api/table/%5BtableId%5D/rows/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4657/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4657/files#diff-1d524d6cc0249dc92450d77e6a2572ddeebca5658f48b15a06026fefe7c8713e
https://github.com/simstudioai/sim/pull/4657/files#diff-1d524d6cc0249dc92450d77e6a2572ddeebca5658f48b15a06026fefe7c8713e
https://github.com/simstudioai/sim/pull/4657/files#diff-1d524d6cc0249dc92450d77e6a2572ddeebca5658f48b15a06026fefe7c8713e
https://github.com/simstudioai/sim/pull/4657/files#diff-1d524d6cc0249dc92450d77e6a2572ddeebca5658f48b15a06026fefe7c8713e
https://github.com/simstudioai/sim/pull/4657/files#diff-1d524d6cc0249dc92450d77e6a2572ddeebca5658f48b15a06026fefe7c8713e
https://github.com/simstudioai/sim/pull/4657/files#diff-1d524d6cc0249dc92450d77e6a2572ddeebca5658f48b15a06026fefe7c8713e
https://github.com/simstudioai/sim/pull/4657/files#diff-1d524d6cc0249dc92450d77e6a2572ddeebca5658f48b15a06026fefe7c8713e
apps/sim/app/api/v1/tables/[tableId]/rows/route.tshttps://github.com/simstudioai/sim/pull/4657/files#diff-66da8dda9c2be82f25e925ab86c5165605398d122a0aa192cd7665b2819bb067
View file https://github.com/simstudioai/sim/blob/6a87e6e5f1b07e4e0ed552718b860cfa2a90d3a6/apps/sim/app/api/v1/tables/%5BtableId%5D/rows/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4657/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4657/files#diff-66da8dda9c2be82f25e925ab86c5165605398d122a0aa192cd7665b2819bb067
https://github.com/simstudioai/sim/pull/4657/files#diff-66da8dda9c2be82f25e925ab86c5165605398d122a0aa192cd7665b2819bb067
https://github.com/simstudioai/sim/pull/4657/files#diff-66da8dda9c2be82f25e925ab86c5165605398d122a0aa192cd7665b2819bb067
https://github.com/simstudioai/sim/pull/4657/files#diff-66da8dda9c2be82f25e925ab86c5165605398d122a0aa192cd7665b2819bb067
https://github.com/simstudioai/sim/pull/4657/files#diff-66da8dda9c2be82f25e925ab86c5165605398d122a0aa192cd7665b2819bb067
https://github.com/simstudioai/sim/pull/4657/files#diff-66da8dda9c2be82f25e925ab86c5165605398d122a0aa192cd7665b2819bb067
https://github.com/simstudioai/sim/pull/4657/files#diff-66da8dda9c2be82f25e925ab86c5165605398d122a0aa192cd7665b2819bb067
apps/sim/lib/copilot/tools/handlers/function-execute.tshttps://github.com/simstudioai/sim/pull/4657/files#diff-e6d4d4c49c334453d57aa77c7e31d792717e1d0c94b39df8d6021b98a561c91c
View file https://github.com/simstudioai/sim/blob/6a87e6e5f1b07e4e0ed552718b860cfa2a90d3a6/apps/sim/lib/copilot/tools/handlers/function-execute.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4657/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4657/files#diff-e6d4d4c49c334453d57aa77c7e31d792717e1d0c94b39df8d6021b98a561c91c
https://github.com/simstudioai/sim/pull/4657/files#diff-e6d4d4c49c334453d57aa77c7e31d792717e1d0c94b39df8d6021b98a561c91c
apps/sim/lib/copilot/tools/server/table/user-table.tshttps://github.com/simstudioai/sim/pull/4657/files#diff-f226f84ebf59d60c85e117fec4b44d258fed6a0a424dc27695e921ceee6a1d41
View file https://github.com/simstudioai/sim/blob/6a87e6e5f1b07e4e0ed552718b860cfa2a90d3a6/apps/sim/lib/copilot/tools/server/table/user-table.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4657/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4657/files#diff-f226f84ebf59d60c85e117fec4b44d258fed6a0a424dc27695e921ceee6a1d41
https://github.com/simstudioai/sim/pull/4657/files#diff-f226f84ebf59d60c85e117fec4b44d258fed6a0a424dc27695e921ceee6a1d41
https://github.com/simstudioai/sim/pull/4657/files#diff-f226f84ebf59d60c85e117fec4b44d258fed6a0a424dc27695e921ceee6a1d41
https://github.com/simstudioai/sim/pull/4657/files#diff-f226f84ebf59d60c85e117fec4b44d258fed6a0a424dc27695e921ceee6a1d41
https://github.com/simstudioai/sim/pull/4657/files#diff-f226f84ebf59d60c85e117fec4b44d258fed6a0a424dc27695e921ceee6a1d41
https://github.com/simstudioai/sim/pull/4657/files#diff-f226f84ebf59d60c85e117fec4b44d258fed6a0a424dc27695e921ceee6a1d41
https://github.com/simstudioai/sim/pull/4657/files#diff-f226f84ebf59d60c85e117fec4b44d258fed6a0a424dc27695e921ceee6a1d41
https://github.com/simstudioai/sim/pull/4657/files#diff-f226f84ebf59d60c85e117fec4b44d258fed6a0a424dc27695e921ceee6a1d41
https://github.com/simstudioai/sim/pull/4657/files#diff-f226f84ebf59d60c85e117fec4b44d258fed6a0a424dc27695e921ceee6a1d41
https://github.com/simstudioai/sim/pull/4657/files#diff-f226f84ebf59d60c85e117fec4b44d258fed6a0a424dc27695e921ceee6a1d41
https://github.com/simstudioai/sim/pull/4657/files#diff-f226f84ebf59d60c85e117fec4b44d258fed6a0a424dc27695e921ceee6a1d41
https://github.com/simstudioai/sim/pull/4657/files#diff-f226f84ebf59d60c85e117fec4b44d258fed6a0a424dc27695e921ceee6a1d41
https://github.com/simstudioai/sim/pull/4657/files#diff-f226f84ebf59d60c85e117fec4b44d258fed6a0a424dc27695e921ceee6a1d41
https://github.com/simstudioai/sim/pull/4657/files#diff-f226f84ebf59d60c85e117fec4b44d258fed6a0a424dc27695e921ceee6a1d41
https://github.com/simstudioai/sim/pull/4657/files#diff-f226f84ebf59d60c85e117fec4b44d258fed6a0a424dc27695e921ceee6a1d41
apps/sim/lib/copilot/tools/server/visualization/generate-visualization.tshttps://github.com/simstudioai/sim/pull/4657/files#diff-77c01651e0c8b3592fed25603660f1c71324a878afbb356d666c32cf89f2eaa7
View file https://github.com/simstudioai/sim/blob/6a87e6e5f1b07e4e0ed552718b860cfa2a90d3a6/apps/sim/lib/copilot/tools/server/visualization/generate-visualization.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4657/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/4657/files#diff-77c01651e0c8b3592fed25603660f1c71324a878afbb356d666c32cf89f2eaa7
https://github.com/simstudioai/sim/pull/4657/files#diff-77c01651e0c8b3592fed25603660f1c71324a878afbb356d666c32cf89f2eaa7
apps/sim/lib/table/__tests__/service-filter-threading.test.tshttps://github.com/simstudioai/sim/pull/4657/files#diff-fc16d1af6c583a6c382bb94c9e7945067cee0fb6c9c9c4298546d78f09dfbaaa
View file https://github.com/simstudioai/sim/blob/6a87e6e5f1b07e4e0ed552718b860cfa2a90d3a6/apps/sim/lib/table/__tests__/service-filter-threading.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/4657/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/4657/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/4657/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.