sql-js / sql-js/sql.js

feature-request: support 64bit bigint

Aperta
#341 14 commenti 3 reazioni 0 assegnatari Vedi su GitHub

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

not sure how feasible this feature-request is. sqlite3 docs say INTEGERS can be 1, 2, 3, 4, 6, or 8 bytes.

is it possible to:

  1. input - allow 64-bit bigint as a param input? e.g.
db.exec({
    params: {
        "@bigint": 12345678901234567890n
    },
    sql: "SELECT @bigint"
});
  1. output - if integer > Number.MAX_SAFE_INTEGER, then allow option to auto-coerce it to bigint? e.g.
db.exec({
    preserveIntegerPrecision: true,
    sql: "SELECT 1234 AS int, 1234567890123456789 AS bigint"
});
/*
{
    "results": [
        {
            "columns": [
                "int",
                "bigint"
            ],
            "values": [
                [
                    1234,
                    12345678901234567890123456789n
                ]
            ]
        }
    ]
}
 */

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Start with the db.exec parameter-binding path shown in the issue and the result conversion path for SQLite integers. Compare the requested bigint input and preserveIntegerPrecision output examples with SQLite's integer behavior; done means both cases have agreed semantics and coverage for safe and unsafe integer values.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, sqlite
Ambito
databases
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.