Load SQLite extensions in SchemaCrawler - sqlite

My SQLite database has a virtual table that is created by using the spelfix1.dll extention.
Is there any solution to load this extention in schemacrawler?
When I try to create the graphic with
schemacrawler --server=sqlite --database=/home/schcrwlr/share/database.db --info-level=minimum --command=list --output-file=/home/schcrwlr/share/output.png
after starting the container with
C:\Users\user> docker run `
-v ${PWD}:/home/schcrwlr/share `
--name schemacrawler `
--rm -i -t `
--entrypoint=/bin/bash `
schemacrawler/schemacrawler:v16.16.6
Schemacrawler execution stop because the extenion is missing according to the log-files
Caused by: schemacrawler.schemacrawler.exceptions.WrappedSQLException: Could not retrieve table columns for table <lang_store>: [SQLITE_ERROR] SQL error or missing database (no such module: spellfix1)
and
Caused by: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (no such module: spellfix1)
I work in the Windows PowerShell on Win10.
Environment:
SchemaCrawler 16.16.6
Linux 5.10.16.3-microsoft-standard-WSL2
Oracle Corporation OpenJDK 64-Bit Server VM 17-ea+14
SQLite 3.36.0
SQLite JDBC 3.36.0.3

This is more a question about the SQLite JDBC driver than about SchemaCrawler. The SchemaCrawler Docker image comes bundled with SQLite JDBC driver and does not allow for reading of external extension libraries for security reasons. If you really wanted to do this, you would have to use the regular distribution of SchemaCrawler and provide the extension DLL file in the lib folder. Or you could build your own Docker image with this extension, based on the SchemaCrawler Docker image. All of this seems like too much work.
Your best bet is the strip the schema of the virtual tables and run SchemaCrawler again. Please take a look at the procedure for doing this in the answer to Reflecting sqlite database with spellfix1 tables
Sualeh Fatehi, SchemaCrawler

Related

How do I create a database on MariaDB server?

My hosting provider shows Server version: 10.1.44-MariaDB-cll-lve - MariaDB Server on cPanel.
I'm about to do some dev work locally.
I installed MariaDB on my Windows 10. It went under C:\Program Files\MariaDB 10.4 and I see that it installed itself as a service called MariaDB. Service is running.
I'm asking my question after trying a whole whack of things because I had done this many times using MySQL before this MariaDB thing.
How do I create a database off an sql dump file?
Since nothing that I'm trying is working and this is a brand new Maria DB installation , I would rather not talk about how I did this before. Instead, having this MariaDB installation now, what do I do to import this sql file?
OK, so this is what we need to do:
Assuming that your database is called MyDB.
Start command prompt as admin.
cd C:\Program Files\MariaDB 10.4\bin> // /bin where your MariaDB installation went.
mysql -u root
create database MyDB;
exit;
mysql -uroot MyDB < C:/where-you-have-the-file/dump-file.sql
mysql -u root
use MyDB
show tables;
Hopefully, you see your schema.

Difference in MariaDB installation packages on RHEL server?

On trying to install MySql on RHEL7 I came to know that we need to use MariaDB instead.
I tried the installation on my machine which is RHEL6 by adding MariaDB.repo file to /etc/yum.repos.d/ with following lines -
[mariadb]
name = MariaDB-5.5.39
baseurl=https://downloads.mariadb.com/files/MariaDB/mariadb-5.5.39/yum/rhel6-amd64/
# alternative: baseurl=http://archive.mariadb.org/mariadb-5.5.39/yum/rhel6-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
https://mariadb.com/kb/en/mariadb/yum/
Thereafter I installed it successfully using following command -
sudo yum install MariaDB-server MariaDB-client
Now on an RHEL7 production box same steps failed with following conflict -
file /etc/my.cnf from install of MariaDB-common-5.5.39-1.el6.x86_64 conflicts with file from package maria-libs-1:5.5.44-2.el7.x86_64
So I understand I am pointing to rhel6 repo on rhel7 and probably some pre-installed files are in conflict.
But when I execute below mysql/mariadb gets installed successfully, what difference does case make here?
sudo yum install mariadb mariadb-server
I am not sure if it is linked to a different repository in background, I dont have access to the instance to dig further in repo settings, can anyone help me out here?
You can clarify that using yum search mariaDB
I executed that an ended up with same result as mariaDB and mariadb
============================= N/S matched: mariaDB =============================
mariadb-bench.x86_64 : MariaDB benchmark scripts and data
mariadb-devel.i686 : Files for development of MariaDB/MySQL applications
mariadb-devel.x86_64 : Files for development of MariaDB/MySQL applications
mariadb-libs.i686 : The shared libraries required for MariaDB/MySQL clients
mariadb-libs.x86_64 : The shared libraries required for MariaDB/MySQL clients
mariadb-server.x86_64 : The MariaDB server and related files
mariadb.x86_64 : A community developed branch of MySQL
mariadb-test.x86_64 : The test suite distributed with MariaD
Name and summary matches only, use "search all" for everything.

sqlite odbc silent install

How to Silent install sqlite odbc driver ?. Found here http://www.ch-werner.de/sqliteodbc/
i found 2 methods to connect to sqlite one is above and the other one is dhSqlite(vbRichclient4.dll,vb_cairo_sqlite.dll and DirectCOM.dll). which is a class library and replacement for ADO it seems for sqlite. but i could not find any documentation for this one.
i like sqliteodbc because it just works with ADO. but dhsqlite can be installed along with the app. Also dhSqlite contains the sqlite3 engine also i suppose. is it true?.
Could you suggest which one i could follow? or is there any other option i could check?. I am looking for it to be a silent install or install as
part of my app. itself; free and supported for vb6
Thanks
If you use Inno Setup for distributing your application and use sqliteodbc 0.9996 version, we can add script like this:
[Files]
Source: sqliteodbc0.9996.exe; DestDir: {tmp}; Flags: deleteafterinstall
[Run]
Filename: {tmp}\sqliteodbc0.9996.exe; Parameters: /S; StatusMsg: "Installing SQLite ODBC Connector..."
Win32 install/remove/shell by RUNDLL32
Each driver DLL provides entry points for ODBC driver installation
and removal which can be invoked from RUNDLL32.EXE, eg
### install sqliteodbc.dll
C:> rundll32 [path]sqliteodbc.dll,install [quiet]
### remove sqlite3odbc.dll
C:> rundll32 [path]sqlite3odbc.dll,uninstall [quiet]

MariaDB on Windows - what is this error when trying to start the database engine?

I am asking this question as an offshoot myself and another SO had from this other MariaDB question:
MariaDB on Windows - getting started help?
When I install MariaDB (v5.2.4), open the command window, navigate to the folder where the files are installed, and type in the following to start the database:
net start mysql
I get the following error:
the service name is invalid
I didn't do anything complex, just ran the installation and tried to get started.
Any ideas?
The error basically tells that installer did not create the service (it currently does not create services), thus you'll need to do it yourself.
start elevated command line
switch to directory of your MariaDB installation (C:\Program Files\MariaDB 5.2.4, something like that)
bin\mysqld --install
and only then
net start mysql
Assuming that there is nothing that runs on port 3306, this will stat.
Alas, the server you will create this way would not be optimized at all.
It is better to create a configuration file my.ini (take a look at MySQL docs and .ini files in the installation directory for examples), and put with performance -related stuff here (innodb bufferpool size etc). With config file, you'll need a different command line to register service (step 3 above):
bin\mysqld --install MySQL --defaults-file=path\to\my.ini
Installer for 5.2.4 is basic indeed. It is being reworked though, new one is going to be better usable.
I installed MariaDB that comes with XAMPP on Windows 10. You will see only mysql in the XAMPP Control Panel. However, if you click Shell on the control panel you can access MariaDB monitor and MariaDB.
Here are some notes:
http://hodentekhelp.blogspot.com/2015/11/how-do-you-access-mariadb-in-xampp.html

Drupal 7 configuration error with Postgresql in Mac OS 10.6.5

I am trying to configure Drupal 7 with Postgres. At the database setup step, I get the following error.
Warning: PDO::_construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in DatabaseConnection->_construct() (line 300 of /Users/shamod/Sites/drupal/7/includes/database/database.inc).
In order for Drupal to work, and to continue with the installation process, you must resolve all issues reported below. For more help with configuring your database server, see the installation handbook. If you are unsure what any of this means you should probably contact your hosting provider.
Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2002] No such file or directory.
Is the database server running?
Does the database exist, and have you entered the correct database name?
Have you entered the correct username and password?
Have you entered the correct database hostname?
NOTE: I am trying to connect to Postgresql but it fails on var/mysql/mysql.sock error. I have setup the database connection string in settings.php for Postgresql. It still does not work.
Any idea?
Evidently you are trying to connect to a MySQL database instance, so you should review your database driver and connection configuration.
Just came up against this error myself when trying to use the web installer - might come down to a similar issue.
On the install page I wasn't given an option to use Postgres driver so I assumed I needed to use the "Mysql (or other)" option. However, looks like the Drupal install script checks which database drivers are compiled into PHP and only offers you what is available - my system didn't have php-pgsql installed by default.
So I needed to install the postgresql drivers to PHP first, reload apache then try the install again.
On CentOS-5:
sudo yum install php-pgsql
sudo service httpd restart
Then reload the install page and all worked fine.

Resources