2 ms·
Question for those that have success with it. How did you handle auto complete with something like SQL where you need to query the db for table and column info
by indigo0086 2y ago
Question for those that have success with it. How did you handle auto complete with something like SQL where you need to query the db for table and column info while remaining performant.
- AlexErrant 2y agoFYI `schemaCompletionSource` exists https://github.com/codemirror/lang-sql#user-content-schemacompletionsource https://github.com/codemirror/lang-sql#user-content-schemaco... But if you want an example of async completion, I do it here https://github.com/AlexErrant/Pentive/blob/fe86a8a185e4be47045f62bfd47562312546b371/shared-dom/src/language/queryCompletion.ts#L50-L53 https://github.com/AlexErrant/Pentive/blob/fe86a8a185e4be470... which is called from here https://github.com/AlexErrant/Pentive/blob/fe86a8a185e4be47045f62bfd47562312546b371/app/src/components/queryEditor.tsx#L200-L205 https://github.com/AlexErrant/Pentive/blob/fe86a8a185e4be470... Perf isn't really a problem for me since I'm calling SQLite in the browser; it's maybe 10-20ms.