Completion in SQL, JavaScript and R
Until now, only Basthon's Python completed names with the Tab key. SQL, JavaScript and R now do too, in the console, the notebook and the basthon command. No more typos in the names of columns!
In SQL, completion knows the keywords and the functions (in the case you type: sel gives select), the tables of the database and their columns, including through an alias: after FROM eleves e, e. offers the columns of eleves. SQLite's commands (.tables, .schema…) are completed too.
CREATE TABLE eleves (id INTEGER PRIMARY KEY, nom TEXT, prenom TEXT, classe TEXT);
CREATE TABLE notes (eleve INTEGER REFERENCES eleves(id), matiere TEXT, note REAL);
INSERT INTO eleves VALUES (1, 'Lovelace', 'Ada', '1G3'), (2, 'Turing', 'Alan', '1G3'), (3, 'Hopper', 'Grace', 'TG2');
INSERT INTO notes VALUES (1, 'NSI', 18), (1, 'Maths', 17), (2, 'NSI', 19), (3, 'NSI', 16), (3, 'Maths', 15);
-- in the console, try Tab after "SELECT * FROM el" or "SELECT * FROM eleves e WHERE e."
SELECT e.prenom, e.nom, AVG(n.note) AS moyenne
FROM eleves e JOIN notes n ON n.eleve = e.id
GROUP BY e.id
ORDER BY moyenne DESC;
In JavaScript, variables, keywords and the properties of objects are completed, along a path of names: car.model.n offers name, and Math.fl gives floor(.
In R, R's own completer does the work: objects, arguments of functions (sum(1, na.r gives na.rm=), elements of a list (car$m), functions of a package (utils::he).