sasha-alias / sqltabs

Rich SQL client for Postgresql, MySQL, MS SQL, Amazon Redshift, Google Firebase (Firestore)
https://www.sqltabs.com
GNU General Public License v3.0
803 stars 57 forks source link

Windows Version #23

Closed flesler closed 7 years ago

flesler commented 8 years ago

Hi,

sqltabs seems pretty awesome, are you planning on adding a Windows version? Github is lacking a way to ask questions other than by creating an issue :D

carsonyl commented 8 years ago

I tried to compile it on Windows 10 x64 just now. I can get it to build and run, but when I try to run a query or use the Database Info command, the output pane either shows the # Executing... timer increasing forever, or the entire app becomes a white screen. There are no relevant messages in the F12 console.

I suspect the issue involves node-libpq and its DLL dependencies. Though libpq appears to build successfully, I am unable to load it:

C:\Users\carso\OneDrive\Documents\sqltabs>node
> var v = require('libpq');
var v = require('libpq');
Error: The specified module could not be found.
\\?\C:\Users\carso\OneDrive\Documents\sqltabs\node_modules\libpq\build\Release\a
ddon.node
    at Error (native)
    at Object.Module._extensions..node (module.js:460:18)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at bindings (C:\Users\carso\OneDrive\Documents\sqltabs\node_modules\libpq\no
de_modules\bindings\bindings.js:76:44)
    at Object.<anonymous> (C:\Users\carso\OneDrive\Documents\sqltabs\node_module
s\libpq\index.js:1:108)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
sasha-alias commented 8 years ago

Actually the only tech problem with Windows version is to make a node-libpq library working there. More precisely, synchronous part of node-libpq works OK, but async doesn't. SQL Tabs is entirely asynchronous so this is why it can't run queries. There is a corresponding issue in the node-libpq which I wasn't able to hack around and apparently there are no experienced devs with Windows background who could help with that. Thus help with this issue is very appreciated.

carsonyl commented 8 years ago

Ah, that's good to know. Sounds like the problem I encountered with libpq is a different issue.

Which version of Visual Studio did you use? I tried with 2015. Also, I noticed that your libpq_build.sh exports 3 variables, while .npmrc only has two of them. I added target=0.27.1 to .npmrc to make npm install libpq succeed. I should mention that I have no experience with Node, and don't know the significance of these variables or why they influence libpq.

sasha-alias commented 8 years ago

Electron is using different version of V8 from official Node. So by defining these vars you specify which headers to use for compiling native modules. Note that the issue is common for both node and electron. So you can reproduce it with pure nodejs and try to fix there. Once it's done, you will need to recompile with Electron headers so it works with SQL Tabs. The example of how to reproduce the bug is in the linked issue from node-libpq repo.

PS I also tried it with VS2015 iirc. Maybe it worths to make a try with earlier versions.

podhy commented 8 years ago

I successfully build sqltabs on Windows 10 when I use latest libpq. But when I run app it gives error: Uncaught ReferenceError: connstr is not defined", source: D:\Projects\sqltabs\build\Executor.js (46)

Any suggestion?

sasha-alias commented 8 years ago

It was a bug in autocompletion, see the recent commit ^. And yeah, actually SQL Tabs works on windows since this got fixed. Just I never got to the point to make a proper windows build.

sasha-alias commented 7 years ago

SQL Tabs for Windows released. You can download it here http://www.sqltabs.com Please report any issues, as it's the first windows build I would expect some. Thanks