Add javascript function as a substitute to postgresql stored procedures / functions in postgresq
Aperta
Nessuno ha ancora preso questa issue.
enhancement
- Lingua principale
- JavaScript
- Stelle
- 13.7k
- Fork
- 1.1k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Add an ability for sql.js to apply custom javascript function in the SQL.
Would it be cool to see this in sql.js
CREATE TABLE people_location(
person_id int,
latitude double,
longitude double,
);
-- see people within 5 KM radius
SELECT * FROM people_location WHERE compute_distance(latitude, longitude, my_lat, my_long) <= 5;
function compute_distance(lat1, lon1, lat2, lon2){
var φ1 = lat1.toRadians(), φ2 = lat2.toRadians(), Δλ = (lon2-lon1).toRadians(), R = 6371; // gives d in km
var d = Math.acos( Math.sin(φ1)*Math.sin(φ2) + Math.cos(φ1)*Math.cos(φ2) * Math.cos(Δλ) ) * R;
return d;
}
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
The issue names no files, tests, or entry points. Start by locating how sql.js exposes SQLite functionality to JavaScript, then establish the intended registration and invocation behavior for custom SQL functions. Done means a JavaScript function can be registered, called from SQL, and covered by a focused test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, sqlite
- Ambito
- database
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100