I have many layers in a qgis project from the same postgis database. This project is saved in the same postgis database. OK, it works fine...
I copy this qgis project in anothers databases with exactly the same schema. When I open it in the others databases, the layers are still connected to the first database but I wloud like to connect them to the same database as the project... like an relative path with files (and not a absolute)... How can I do it ?
Or is-it possible to create a pyqgis function called when I open the project to dynamically change the dbanme of all postgis's layers to the same database as the project ?
I'm sure it can be possible....
thank's
Related
I created a database project as part of my solution with scripts for my tables. I'm using database first, so all I do is run the project to build/deploy my tables to the database.
I'm working with a few others so I checked the SQL project into TFS.
So the other people can get the solution, run the SQL project and generate the local database for themselves.
The problem is, it might generate them under another local instance. For instance, on my home computer, it generated it under (localdb)\Projects, but on my laptop, under (localdb)\ProjectsV12.
This breaks the connection strings (which of course can be fixed). But this leaves me wondering, is there a better way to develop the SQL project collaboratively?
If you have the SQL code under source control then everyone can open that solution to edit/create copies of the database. Ideally you have an automated process but that does not work for local dev.
Since sharing code is a bad idea and you have expressed that the database is used by more than one solution I would consider packaging and distributing it.
If you create a SSDT database project you can compile your database into a package that can upgrade any instance. You can then share that .dacpac output easily.
You might even what to share it with Nuget so that each dependency is automatically updated.
You can setup a SQL alias name to standardize the connection string across developer machines.
Alias .\SQLEXPRESS to (LocalDB)\MSSQLLocalDB
I'm in the middle of doing a personal project and would like to create a system of three components.
A simple form application that would allow the user to input data into a database.
A database of multiple tables.
An excel spreadsheet that queries the database.
At this point in the project, there is a desire for the database to be stored on the PC of the person working on the project and for all three components of the project to have the ability to be zipped up in a folder and emailed around. I know how to code well enough to query databases from applications and excel, but how can I go about creating a database that can be stored in a specific folder so it can be emailed around?
Thanks!
Look into sql compact edition
http://en.wikipedia.org/wiki/SQL_Server_Compact
http://xldennis.wordpress.com/2010/08/30/using-sql-server-compact-edition-database-with-excel/
MS Access might also be an option here.
I am creating a database on a WAMP server, running locally on my machine for now. I want to organize audio files, I understand I can use BLOB in the database but this is apparently very slow. I thought the best way would be to use a database with a reference to the location of the audio file. How do you achieve this using WAMP server? I have created the database, I need to add a folder of some onto the server. Also is there any other way of trying to get where I want?
Problem resolved by using folder on saved on the server and using webclient class (C#) to upload the file and SQL to alter the database which holds information on that file, including the location in the server.
We have an existing SQL Server database, and I'd like to create a Visual Studio database project for it and put some of the scripts for the stored procedures in that database in source control. So, I thought I would create a new database project. Is there a way I can wire up this database project to the database? I thought it might be "Add Database Reference", but that only gives me options to use some other database project in the current solution, not set up the current project to be connected to an actual database.
Ideally, I'd like to be able to right-click on my project and do a "Publish" and have all my database info prefilled. I realize that I might be thinking of this wrong, but searching around on the web is of little help. It is surprising how poorly these concepts are documented.
EDIT: After the first answer, maybe my question really is: How can I have only a part of a database managed in a database project? I had assumed this was an ordinary thing that people did all the time with database projects, but maybe not. In my case, I would like to have only some of the stored procedures in source control.
After further reasearch, it seems the answer is, "no, there is no way" to have only a part of a database managed in a database project.
I'm using vs 2013 but i think this is valid back VS 2008
Right click database project.
Then choose -> import -> database.
Setup a connection to your target database.
When you import select the import setting Folder structure Schema\Object type
And run the wizard.
This builds a folder structure containing sql script for your schema objects.
Alternatively if you have sql data tools you could run the schema compare against a blank project.
I was wondering how databases are managed in open source projects which are usually hosted in repositories like CVS or SVN. Placing codes in the SVN is very logical as it allows different team members to get updated pieces of code but how about databases?
Are their schemas and contents (.sql files I assume) placed inside the SVN too? In this case if I were creating a web application, would this require developers to keep on updating their local databases with the newest .sql file?
Or, is it more like having a central server which members can modify and their software just connects to over the net?
I'm planning to start an open source web application project (which requires the use of a database) but am a bit confused of how to go about the database management part.
Typically you would include one or two things:
Schema creation scripts
Initial data to be loaded into the database
Both of these should be text files. If your data needs any special processing before it can be loaded into the DBMS, then include a tool for that too.
One thing you should not do is include any particular binary database file in your source control. For example, a SQLite database file would not be appropriate. Binary database files are not normally portable across architectures or versions.
In my experience these types of applications usually include a database set up included with the build. Usually you have to install the DB where you need it then install the client. Also, usually these databases are also open source like MySQL or something.
This depends on the project you are doing. For example if all the developers are in same location in one company, the central database server may be applicaple. If the developers are distributed around the world, then the central database server is probably out of the question and every developer creates his own copy of database for development.
I would think that most common option is that every developer uses his own database.
In any case you'll want to keep the schema creation and initial data creation files in version control. This way all the developers can create a new database easily.