Configure Qt Creator to work with PostgreSQL to extensions development

Started by Fabiana Ziotialmost 9 years ago6 messagesgeneral
Jump to latest
#1Fabiana Zioti
fabi_zioti@hotmail.com

I'm creating an extension to PostgreSQL, with user-defined types and user-defined functions.

Extensions can be written in C as well as C ++, correct?
I am currently using ATOM to develop in Ubuntu. But I would like to work with Qt.

PostgreSQL provides the tutorial for working with eclipse: https://wiki.postgresql.org/wiki/Working_with_Eclipse#

Is there any tutorial for Qt? Or are the setup steps similar to Eclipse?

Thank you very much in advance.

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Fabiana Zioti (#1)
Re: Configure Qt Creator to work with PostgreSQL to extensions development

On 06/25/2017 07:34 AM, Fabiana Zioti wrote:

I'm creating an extension to PostgreSQL, with user-defined types and
user-defined functions.

Extensions can be written in C as well as C ++, correct?

Given that you are asking about Qt Creator do you mean written in C++ as
well as C?

An extension is just packaging of objects:

https://www.postgresql.org/docs/9.6/static/extend-extensions.html

I am not sure C/C++ really is a factor.
Maybe if you offer more detail on what you are trying to achieve.

I am currently using ATOM to develop in Ubuntu. But I would like to work
with Qt.

Not seeing how Qt will work in a Postgres extension?

PostgreSQL provides the tutorial for working with eclipse:
https://wiki.postgresql.org/wiki/Working_with_Eclipse#

Is there any tutorial for Qt? Or are the setup steps similar to Eclipse?

Thank you very much in advance.

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Andreas Joseph Krogh
andreas@visena.com
In reply to: Adrian Klaver (#2)
Re: Configure Qt Creator to work with PostgreSQL to extensions development

På søndag 25. juni 2017 kl. 17:04:02, skrev Adrian Klaver <
adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>:
On 06/25/2017 07:34 AM, Fabiana Zioti wrote:

I'm creating an extension to PostgreSQL, with user-defined types and
user-defined functions.

Extensions can be written in C as well as C ++, correct?

Given that you are asking about Qt Creator do you mean written in C++ as
well as C?

An extension is just packaging of objects:

https://www.postgresql.org/docs/9.6/static/extend-extensions.html

I am not sure C/C++ really is a factor.
Maybe if you offer more detail on what you are trying to achieve.

I am currently using ATOM to develop in Ubuntu. But I would like to work
with Qt.

Not seeing how Qt will work in a Postgres extension?
 
I think what he's asking is how to use Qt Creator as a development environment
for developing PG-extentions, not linking Qt in from an extention.
 
-- Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
andreas@visena.com <mailto:andreas@visena.com>
www.visena.com <https://www.visena.com&gt;
<https://www.visena.com&gt;

 

#4Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Andreas Joseph Krogh (#3)
Re: Configure Qt Creator to work with PostgreSQL to extensions development

On 06/25/2017 01:34 PM, Andreas Joseph Krogh wrote:

På søndag 25. juni 2017 kl. 17:04:02, skrev Adrian Klaver
<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>:

On 06/25/2017 07:34 AM, Fabiana Zioti wrote:

I'm creating an extension to PostgreSQL, with user-defined types and
user-defined functions.

Extensions can be written in C as well as C ++, correct?

Given that you are asking about Qt Creator do you mean written in C++ as
well as C?

An extension is just packaging of objects:

https://www.postgresql.org/docs/9.6/static/extend-extensions.html

I am not sure C/C++ really is a factor.
Maybe if you offer more detail on what you are trying to achieve.

I am currently using ATOM to develop in Ubuntu. But I would like

to work

with Qt.

Not seeing how Qt will work in a Postgres extension?

I think what he's asking is how to use Qt Creator as a development
environment for developing PG-extentions, not linking Qt in from an
extention.

Even if that is the case, Qt Creator is optimized for building GUI's
based on Qt, I suspect the OP will be fighting it to build Postgres
extensions. Seems to me sticking with Atom would be the wiser choice. At
any rate the above awaits more information for confirmation.

--
*Andreas Joseph Krogh*

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5Andreas Joseph Krogh
andreas@visena.com
In reply to: Adrian Klaver (#4)
Re: Configure Qt Creator to work with PostgreSQL to extensions development

På søndag 25. juni 2017 kl. 23:02:32, skrev Adrian Klaver <
adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>:
On 06/25/2017 01:34 PM, Andreas Joseph Krogh wrote:

På søndag 25. juni 2017 kl. 17:04:02, skrev Adrian Klaver
<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>:

     On 06/25/2017 07:34 AM, Fabiana Zioti wrote:
      > I'm creating an extension to PostgreSQL, with user-defined types and
      > user-defined functions.
      >
      > Extensions can be written in C as well as C ++, correct?

     Given that you are asking about Qt Creator do you mean written in C++ as
     well as C?

     An extension is just packaging of objects:

     https://www.postgresql.org/docs/9.6/static/extend-extensions.html

     I am not sure C/C++ really is a factor.
     Maybe if you offer more detail on what you are trying to achieve.

      > I am currently using ATOM to develop in Ubuntu. But I would like
     to work
      > with Qt.

     Not seeing how Qt will work in a Postgres extension?

I think what he's asking is how to use Qt Creator as a development
environment for developing PG-extentions, not linking Qt in from an
extention.

Even if that is the case, Qt Creator is optimized for building GUI's
based on Qt, I suspect the OP will be fighting it to build Postgres
extensions. Seems to me sticking with Atom would be the wiser choice. At
any rate the above awaits more information for confirmation.
 
I'd give CLion a try: https://www.jetbrains.com/clion/
 
-- Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
andreas@visena.com <mailto:andreas@visena.com>
www.visena.com <https://www.visena.com&gt;
<https://www.visena.com&gt;

 

#6Arthur Zakirov
a.zakirov@postgrespro.ru
In reply to: Fabiana Zioti (#1)
Re: Configure Qt Creator to work with PostgreSQL to extensions development

On Sunday, 25 June 2017 17:34:11 MSK, Fabiana Zioti wrote:

I'm creating an extension to PostgreSQL, with user-defined types and
user-defined functions.

Extensions can be written in C as well as C ++, correct?
I am currently using ATOM to develop in Ubuntu. But I would like to work
with Qt.

PostgreSQL provides the tutorial for working with eclipse:
https://wiki.postgresql.org/wiki/Working_with_Eclipse#

Is there any tutorial for Qt? Or are the setup steps similar to Eclipse?

Thank you very much in advance.

I am using QtCreator currently. I tried Atom and Sublime Text. But QtCreator
is more convenient to me.

In short you need to do the following things:
1 - setup code style, use tabs instead of spaces, you can setup
autoindentation
2 - create QtCreator project for PostgreSQL and your extensions by the
following way:
- select File > New File or Project > Import Project > Import Existing
Project, and choose PostgreSQL or extension folder
- in next step choose all files
- QtCreator will create 3 files: *.config, *.files, *.includes
- if you created project for an extension you need to define path to
PostgreSQL include headers. Open *.includes file and write the path there.

With QtCreator you can quickly search necessary files or methods.
https://www.dropbox.com/s/r2b7vgt0wh5ibpm/qtcreator.png?dl=0

I didn't setup other options, because I make PostgreSQL and extensions from
command line. I debug them using dbg, but you can do it also from QtCreator.

--
Arthur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general