emmanueloga_ 11 hours ago

Nice project! I was recently exploring LSPs for SQL. I have an idea to extend their functionality beyond static analysis into runtime data assistance, blending both static and runtime checks.

For example, given these files:

    -- file1.sql
    INSERT INTO authors (id, name) VALUES (42, 'Lolo'), (43, 'Tony');
    
    -- file2.sql
    INSERT INTO posts (id, title, content) VALUES (17, 'Post Title', 'Post Content');
    
    -- file3.sql
    INSERT INTO author_posts (author_id, post_id) VALUES (42, 17);
Imagine an LSPd that scans files, parses incomplete or broken SQL, and suggests data in real-time. For instance, while typing `VALUES (` in file3.sql, it would auto-complete `(42, 'Lolo') or (43, 'Tony')`, inferred from file1.sql.

There are a lot of caveats (like handling insertions, deletions, or the order of operations), but even partially reliable, plausible suggestions would provide enough value.

In my current project, I generate TypeScript for static checks and validate insertions at build time. However, an LSP like this could streamline the data insertion process and reduce the need for admin dashboards.

I’m not aware of any existing LSP servers that function this way. I’m interested in exploring this concept for Kuzu/Cypher since my project data is graph-like, but the idea should be applicable to any data store.