Existing PostgreSQL database used in Pyramid - postgresql

Can someone point to me the relevant documentation that I need to read in order for me to understand how to connect and query an already existing PostgreSQL database which was created outside of Pyramid?
I'm working on a project and my part is to create the web app while a friend is thinking about the database design (he also creates the tables structures).
What I would like is to import in some way the whole structure he created without having to recreate the tables in my models.py document.
Hope this makes sense
Thanks and best regards!

Related

Suitecrm Database schema for multiple companies

How can I separate database using suitecrm.
In My application there is one source code and i want to company wise separate database.
Please help me.
You might need to use seperate installations for keeping them seperate.
Additionally, you can use $sugar_config['db'] variable to dynamically connect with a database of your choice.

What template was used to create my PostgreSQL database

I have a PostgreSQL database that I think was create using a custom template database.
Is there a way to see what template was used to create the database? There doesn't seem to be any documentation that describes this.
As far as I know, no, there is no system catalogue that tracks this. I'm not sure it would be terribly useful to know that database "X" was created from "template2" unless you could prove exactly what the contents of "template2" were at the point of copying. If you're tracking things to that level of detail then you will already have the creation logged.

Load a PostgreSQL database using cloudconnect

On the side of my Gooddata project, I maintain a small PostgreSQL database that contains a few tables.
I would like to be able to integrate both my ETL processes using the same tool, and it seems to me cloudconnect would be the easiest way, since I already have my whole GoodData ETL in it.
Here are the ways I tried to do it without success:
I tried to have a look in the documentation, and it seems to me that all the functionalities of CloverETL that enabled this (DBOutput, PostGreSQLDataWriter) are not available in Cloudconnect.
I managed to connect to the Agile Datawarehouse Service (Database attached to GoodData), but it seems that only the ADS database is able to understand the request:
COPY MyDataBaseTable (field1,field2) FROM LOCAL '${DATA_TMP_DIR}/CIforADS.csv'
even when I adapt the syntax to PostgreSQL because the dynamic addressing I use here does not seem to work.
Is there any way to proceed that I'm missing? Can anyone think of a workaround?
In general this could be achieved by using of "DBExecute" component, but
I'm not sure if I understand it well - do you want to load data into your own Postgres instance using CloudConnect?

how to create a database that is suitable for xcode?

I have understood the basic concepts of core data and how to create schemas or data model in xcode. However I am struggling to create database and import it xcode.
I don't have any experience with creating databases before.
Can somebody guide me here.
Thanks in advance!
If your application is document based, the database is the document. You create it in code when you create the document.
If it's not document based and will use just one single database, then you generally create it in code the first time the application is run (or, more likely, whenever the application is started and it cannot find an already existing database).
In either case if the database can start empty, that's all you need. If an empty database would be invalid and you do need some minimal data when you initialize it, you will have to populate it upon creation.
Depending on how much data your minimal database needs to have you can either hardcode the initialization or use a static resource (that is, a file) in your application bundle containing the initialization data in some form that you know how to read and use that to populate the database.
Using SqlLite is more attractive to me as I import the database without any modifications to the android version.
And I made some generic class to handle any database for android and iPhone but I cannot share it here.
Class DBWRAPPER
{
initDB();
ExecuteScalar()
ExecuteDicionary();
Close();
}
To follow-up on the AnalogFile answer, in case your application is not document base, you probably want to use core data with a preexisting SQLite DB. You could feed your DB with a scripting language like Python. e.g. I think it is a better approach than populating your DB programmatically in XCode. Check this tutorial for more info about this approach.

RavenDB and Inserting data

I recently started using RavenDb. I am converting a relational dbase to use RavenDb. I have two simple tables in the Relational dbase:
tbStates
tbCities
I have all US cities linked to a state. How can I go about converting this to no-sql. Will I have to write a little application to read from the relational dbase and create the objects? Or are there some tools out there I can use to do this?
There is a utility called smuger http://ravendb.net/documentation/smuggler but I imagine you will have to convert your data to Json. It may be just as easy to write a console app that reads the tables to objects then loads to Raven.
Just to add I migrated a SQL Server database to RavenDB using the console application route.
I used EF to quickly pull out the data and converted it to my RavenDB domain then added it to RavenDB.
It Worked well as you will most likely want to tweak the domain anyway to work best with RavenDB (For example I had an Images SQL table that I turned into a List on the document etc).
See Ayende's RacoonBlog project on github (https://github.com/ayende/RaccoonBlog) as he does something similar to move subtext data to RavenDB. RacoonBlog is the engine powering his blog and makes for good learning material about how to use RavenDB.