Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QSql drivers missing #66547

Closed
aanderse opened this issue Aug 13, 2019 · 7 comments
Closed

QSql drivers missing #66547

aanderse opened this issue Aug 13, 2019 · 7 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: closure-size 6.topic: qt/kde

Comments

@aanderse
Copy link
Member

Issue description

QSql has many drivers, listed here: https://doc.qt.io/qt-5/sql-driver.html
In NixOS 19.03 only sqlite, mysql, and psql are available. I would like to be able to utilize more/all of the available drivers, but I don't know how.

Steps to reproduce

Open up the kate text editor, enable the SQL Plugin, attempt to add a new connection and note only limited drivers are available.

Technical details

Please run nix run nixpkgs.nix-info -c nix-info -m and paste the result.

  • system: "x86_64-linux"
  • host os: Linux 4.19.58, NixOS, 19.03.173228.93ea6db29cc (Koi)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.2.2
  • channels(root): "nixos-19.03.173228.93ea6db29cc, nixos-impala-18.03.133402.cb0e20d6db9, nixos-jellyfish-18.09.2574.a7e559a5504, nixos-unstable-19.09pre186857.239fffc90d7"
  • channels(aaron): ""
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

cc @ttuegel in case you have any ideas.

@ttuegel
Copy link
Member

ttuegel commented Aug 13, 2019

Each QSql driver has external dependencies. The default set of drivers was determined by the needs of other packages in Nixpkgs. If you know what dependencies are necessary for the driver you want, you can add those dependencies to qtbase. If the closure size does not increase much, we may add them to Nixpkgs, otherwise you can add the dependencies to your local installation using overrideAttrs.

@aanderse
Copy link
Member Author

@ttuegel I thought the qsql drivers could be added at runtime as plugins. I was hoping to do things this way to avoid having to recompile qt all the time. Adding mssql and oracle qsql drivers to nixpkgs isn't going to happen.

@ttuegel
Copy link
Member

ttuegel commented Aug 13, 2019

I think they can be distributed separately as plugins, but I don't think they can be built outside of the QtBase build. At least, I don't know how to build them separately.

@aanderse
Copy link
Member Author

@ttuegel something (incredibly sloppy) like this seems to work for building:

~/nixpkgs> cat test.nix
{
  mysqlSupport ? true,
  oracleSupport ? false,
  odbcSupport ? true,
  postgresqlSupport ? true,
  tdsSupport ? false
}:
let
  pkgs = import <nixpkgs> {};
in
with pkgs;

stdenv.mkDerivation {
  pname = "qt5-sqldrivers";
  version = (import <nixpkgs/pkgs/development/libraries/qt-5/5.12/srcs.nix> { inherit fetchurl; mirror = "https://download.qt.io"; }).qtbase.version;

  src = (import <nixpkgs/pkgs/development/libraries/qt-5/5.12/srcs.nix> { inherit fetchurl; mirror = "https://download.qt.io"; }).qtbase.src;

  sourceRoot = "qtbase-everywhere-src-5.12.0/src/plugins/sqldrivers";

  nativeBuildInputs = [ qt5.qmake ];
  buildInputs =
    lib.optional mysqlSupport mysql.connector-c ++
    lib.optional oracleSupport oracle-instantclient ++
    lib.optional odbcSupport unixODBC ++
    lib.optional postgresqlSupport postgresql ++
    lib.optional tdsSupport freetds
  ;
}

@aanderse
Copy link
Member Author

@ttuegel I've been able to test this out with kate and it works! I'm hoping you will have some advice on how to best integrate this with nixpkgs. My only need for this is kate, but potentially there are others. Should we make per application options (as the need arises) so that users can add kate.override { oracleSupport = true; } to their systemPackages, make this a global thing, something else...? I'm out of my league here so if you have any ideas how to integrate this nicely into nixpkgs I would really appreciate.

Thanks!

@ttuegel
Copy link
Member

ttuegel commented Aug 14, 2019

In the past, we have provided extra plugins as passthru attributes of qtbase, so I imagine we could have something like qtbase.qsql.oracle, qtbase.qsql.tds, etc. for each plugin. Then, the user could install the plugins as needed and use them in any program.

@stale
Copy link

stale bot commented Oct 2, 2020

Hello, I'm a bot and I thank you in the name of the community for opening this issue.

To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.

If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.

Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: closure-size 6.topic: qt/kde
Projects
None yet
Development

No branches or pull requests

3 participants