1602 / 1602/jugglingdb

Support for MySQL functions?

Đang mở
#167 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
2k
Fork
238
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, mysql
Lĩnh vực
backend, database
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.