1602 / 1602/jugglingdb

Support for MySQL functions?

Ouverte
#167 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
2k
Forks
238
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript, mysql
Domaine
backend, database
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.