1602 / 1602/jugglingdb

Support for MySQL functions?

未关闭
#167 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
2k
派生
238
PR 合并指标
30 天内没有已合并 PR

描述

Hey,

I'd like to use MySQL functions like MBRContains() and GeomFromText(), is there a way to do that?

Right now I'd like to set the `location` property of my model instance to `GeomFromText("LINESTRING(0 0, 1 1)", 4055)`, but (of course) the mysql adapter escapes it.

For querying, you could introduce a `conditions` property for the .all() function that takes a string and a splash of arguments that will be escaped and placed into the question marks inside the string. Just like rails does it.

贡献指南

这个仓库没有索引到贡献指南

调研方向

Look at the MySQL adapter's escaping logic, likely in lib/adapters/mysql.js or similar. The user wants to pass raw SQL functions like GeomFromText for model properties and use a conditions property for .all() queries. Start by examining how property values are currently escaped and how query conditions are built. Check if there's existing support for raw SQL fragments. 'Done' means the adapter can accept and not escape specific MySQL functions for both data assignment and query conditions.

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, mysql
领域
backend, database
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。