How to open/view/import .dbf file in jetbrains datagrip? - datagrip

How do I work with .dbf files in Jetbrains DataGrip ?
I am on macos and need to work with .dbf file. I managed to open dbf file in Shapefile explorer software. But I would like to use cool features DataGrip offering. Is it possible?

I use dbf-to-sqlite Python package - pretty straightforward way to discover DBF structure and data inside. It creates SQLite database which supported by DataGrip out of the box.
pip install dbf-to-sqlite
dbf-to-sqlite PIndx01.dbf post_index.sqlite

There is no way to do that and even there is no ticket in the tracker: https://youtrack.jetbrains.com/issues/DBE

done with shp2pgsql
for example:
shp2pgsql -s 4326 -g geom_4326 "file_name" schema.table | psql -h localhost -p 5432 -d database -U user

Related

Forgot to migrate free tier Postgres and now my app is empty

My project is again live no problems whatsoever, but the database is empty.
I am either trying to restore an old backup to the new Postgres instance or upload a backup from my local disk.
I tried to do pg:restore but I don’t know where to grab the backup (from the free Heroku tier).
I got the answer I was looking for by going into some of the most hidden help articles in heroku.
https://help.heroku.com/QG1W7LIJ/how-do-i-restore-a-partial-backup-or-single-table-to-heroku-postgres
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U YOUR_USERNAME-d CONNECTION_URL mydb.dump
Had to recreate the backup from the local imported database but at the end it worked flawlessly.

How to embeded postgresql into project?

I want to embeded posgresql. i try to print help. there's no options to read config. but the weird. postgres read config from -D options, the file is postgresql.conf that create from initdb.exe. whichis data directory. but the config can set data dir location. so for me is weird management. why not like usual application. just have command to read config file. the real problem is postgres log give error dont know where the lib folder. from postgresql structure folder lib 1 up from bin.
posgresql
postgresql\lib
postgreseql\bin
what i want is lib folder inside bin.
project
project\bin
project\bin\lib
i try to set config that relate to library name, nothing help
dynamic_library_path 'c:\project\bin\lib'
local_preload_libraries
shared_preload_libraries
command that i use to start postgres server
pg_ctl start -s -W -D data -l log/system.log
I am not sure in which programming language or IDE you want to use PostgresSQL. Usually it is easiest to simply include the proper Nuget packages. And it is getting even more easier if you chose to use the EntityFramework to access your data.

Need help understanding Importing Heroku Postgres Databases with PG Backups

I'm reading the documentation here, and I have a few questions. Just to make sure I'm not misunderstanding what this terminal command is supposed to do.
Question 1:
I have an SQLite .db file on my local computer. With this command, I can convert this db into a mydb.dump file, which I can then import into Heroku Postgres. Is this intepretation correct? If so, we can move on to my second question.
Question 2:
Attempting to run PGPASSWORD=mypassword pg_dump -Fc --no-acl --no-owner -h localhost -U myuser mydb > mydb.dump is causing me some issues. From what I can understand, the values I'm supposed to substitute are
mypassword (heroku postgres password)
myuser (I have no idea what's supposed to be here)
mydb (name of db)
mydb.dump (name of dump)
What exactly should go into each of these values, and where can I find them?
The pg_dump command dumps a PostgreSQL database. It has nothing to do with SQLite.
SQLite and PostgreSQL are very different databases. If you're going to use Postgres in production I strongly recommend using it in development as well. In general, your development environment (and any others, like a staging environment) should be as similar as possible to your production environment.

Mac: How to load Postgres Example Database using Postgress.app

I just downloaded the Postgres.app (9.4.5). I want to load (restore) the example database from http://postgresguide.com/setup/example.html. I can't seem to get it imported.
I opened a psql session via the app, exited back to the shell, created a .bash_profile in my home directory (per http://postgresapp.com/documentation/cli-tools.html), quit terminal and opened a new psql session and exited to the shell once again. I then ran the pg_restore command as shown on the example page. I saved the log, but it is 3K lines long and doesn't show any obvious errors. There is nothing in the pgadmin.log in my home directory.
When I start pgAdmin3, I can find no evidence that the database was loaded.
I'm brand new to Postgres, but experienced with Oracle and MySQL.
This is all I see in pgAdmin3. I created the one table in my schema manually.
Did I overlook something?
The pg_restore command on that page does NOT restore the database. It dumps the contents of the backup to stdout. It needs an additional switch '-d' to import directly into a database. But first you have to create an empty database. You can do that from pgAdmin lets say you call it exampledb then the restore would become:
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d exampledb example.dump

Heroku mysqldump to remote host

I created a nice little Rake task to backup our Mysql database on ClearDB to a remote Google storage bucket. Works great locally but running it on Heroku I get this error:
sh: mysqldump: not found
Of course, Heroku doesn't have mysqldump, how silly of me, but is there any way to do this?
The command I'm using is something like this:
system "mysqldump -h host.cleardb.com -u user -p'password' --single-transaction database | gz > #{backup_directory}/#{file_name}"
Of course gzip doesn't exist either on Heroku.
I know there are a couple of gems to backup PostgreSQL databases but I haven't seen anything for Mysql.
This is for a Rails 3.2 app.
Any ideas would be appreciated.
I'd say your best option would be a custom build pack that adds the mysql binaries that you need.
https://devcenter.heroku.com/articles/buildpacks

Resources