mithrandyr / SimplySql

PowerShell module for querying various SQL databases
MIT License
202 stars 30 forks source link

PS core v6 and MacOS/Linux support #18

Closed ghost closed 9 months ago

ghost commented 5 years ago

Hi, regarding #1 - any thoughts about if powershell core and linux/macos will be supported?

mithrandyr commented 5 years ago

@bwhitehead0 -- I'm interested in doing this -- have you tried importing the module in PSCore? What errors do you get? On windows + pscore 6.2, I don't have any errors importing the module.

I don't have ready access to a Linux system at the moment, but if you can report any errors you find on importing the module, I can probably resolve them.

the-mentor commented 5 years ago

hi @mithrandyr I've tried to run SimplySql on linux using powershell core 6.2.2 The import seem to work correctly but when i try to run the Open-SQLiteConnection on a sqlite database i get the following error.

Open-SQLiteConnection ./aFile.db
Exception calling "Open" with "0" argument(s): "Unable to load shared library 'SQLite.Interop.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libSQLite.Interop.dll: cannot open shared object file: No such file or directory"
At /home/myuser/.local/share/powershell/Modules/SimplySql/1.6.2/Providers/SQLite/config.ps1:70 char:11
+     Try { $conn.Open() }
+           ~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DllNotFoundException

There is a possibility that the DLLs need to be built against .net core 2.2 and not .net framework which is Windows only. I'll be happy to further troubleshoot the issue with you. you can reach me either via github or twitter @PoSH4Linux or you can join the PowershellOnLinux group on telegram https://t.me/PowershellOnLinux i'm always there happy to help.

Thanks a bunch for all your hard work !! -DM.

mithrandyr commented 5 years ago

@the-mentor Question -- do you know if this is reproducible via Windows Subsystem for Linux? I'm only briefly familiar with WSL... trying to determine if I need to role an entire Linux VM for testing, or if WSL would provide a sufficient environment to test this in.

the-mentor commented 5 years ago

@mithrandyr I'll try to check if it works in WSL or not and report back.

Thanks. -DM

the-mentor commented 5 years ago

@mithrandyr I was able to reproduce this issue using WSL so you can use it to test.

Let me know if you need further assistance. I'm available on Twitter at @posh4linux

Thanks -DM

the-mentor commented 5 years ago

@mithrandyr I came across this thread that seems to be the exact same issue that happens on my Linux machine and WSL https://system.data.sqlite.org/index.html/tktview/d292f2e23d8a74e0e761 Hopefully it will help

-DM

the-mentor commented 5 years ago

@mithrandyr I did a thing :D Let me know if you have any question about this PR. https://github.com/mithrandyr/SimplySql/pull/22

Thanks. -DM

pcgeek86 commented 2 years ago

I'm getting failures trying to use SimplySql to open a SQLite database on GitHub Actions.

Open-SQLiteConnection: Exception calling ".ctor" with "1" argument(s): "Unable to load shared library 'SQLite.Interop.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libSQLite.Interop.dll: cannot open shared object file: No such file or directory"
mithrandyr commented 9 months ago

Version 2.0 released!