CREATE FUNCTION

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

CREATE FUNCTION

RichardR
Are there any plans to add a CREATE FUNCTION function for SQLite?  Is this an SQLite4 type thing?

Something similar PostgreSQL?
https://www.postgresql.org/docs/9.5/static/sql-createfunction.html

This particular class of function is not mentioned in "SQL Features That SQLite Does Not Implement" and it is not in "SQL As Understood By SQLite"; kind of a grey area, in my mind, for future support.

Richard
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: CREATE FUNCTION

Clemens Ladisch
Rousselot, Richard A wrote:
> This communication is the property of CenturyLink and may contain confidential or privileged information.

So, officially, you did not ask anything?  Well, then I'm not going to answer.


But it should be mentioned that SQLite is an _embedded_ database, i.e., it
is meant to be part of a program written in a 'real' programming language,
so with sqlite3_create_function(), there is no use case for the feature
that you did not ask about


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: CREATE FUNCTION

Richard Hipp-3
On 8/22/16, Clemens Ladisch <[hidden email]> wrote:
>
> But it should be mentioned that SQLite is an _embedded_ database, i.e., it
> is meant to be part of a program written in a 'real' programming language,
> so with sqlite3_create_function(), there is no use case for the feature

I was about to type the same.  SQLite has sqlite3_create_function()
which is more powerful than CREATE FUNCTION and which is a better fit
for the embedded database model.

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: CREATE FUNCTION

J Decker
And every other scripting language you might suggest for the question 'if
It did allow creating a function, what flavor of scripting would you like
it to be?'  has hooks for sqlite ... well except maybe TSQL.  (could I
script all my database access to a sqlite3 db from SQL Server?  Or as the
original poster suggested PLPGSQL? :)
I concur that C/C++ is already a pretty powerful scripting language...
though somewhat prohibits later changes on the fly as customer demands are
clarified... (nothing dynamic libraries and a good design can't overcome I
suppose)

On Mon, Aug 22, 2016 at 12:42 PM, Richard Hipp <[hidden email]> wrote:

> On 8/22/16, Clemens Ladisch <[hidden email]> wrote:
> >
> > But it should be mentioned that SQLite is an _embedded_ database, i.e.,
> it
> > is meant to be part of a program written in a 'real' programming
> language,
> > so with sqlite3_create_function(), there is no use case for the feature
>
> I was about to type the same.  SQLite has sqlite3_create_function()
> which is more powerful than CREATE FUNCTION and which is a better fit
> for the embedded database model.
>
> --
> D. Richard Hipp
> [hidden email]
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: CREATE FUNCTION

Kees Nuyt
In reply to this post by RichardR
On Mon, 22 Aug 2016 18:46:30 +0000, "Rousselot, Richard A"
<[hidden email]> wrote:

> Are there any plans to add a CREATE FUNCTION function for SQLite?
> Is this an SQLite4 type thing?

Many things you would define a SQL function for can also be
accomplished with Common Table Expressions (CTE, WITH) and/or
triggers (especially INSTEAD OF triggers on views).

> Something similar PostgreSQL?
> https://www.postgresql.org/docs/9.5/static/sql-createfunction.html
>
> This particular class of function is not mentioned in "SQL Features
> That SQLite Does Not Implement" and it is not in "SQL As Understood
> By SQLite"; kind of a grey area, in my mind, for future support.

Well,SQLite is supposed to be "lightweight", so I wouldn't count
on future support.
Plus what Clemens Ladisch and Richard Hipp said.

--
Regards,
Kees Nuyt

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: CREATE FUNCTION

RichardR
In reply to this post by Clemens Ladisch
Trust, me if I could remove that dumb message I would. :)

Thanks to everyone for your answers.

-----Original Message-----
From: sqlite-users [mailto:[hidden email]] On Behalf Of Clemens Ladisch
Sent: Monday, August 22, 2016 2:39 PM
To: [hidden email]
Subject: Re: [sqlite] CREATE FUNCTION

Rousselot, Richard A wrote:
> This communication is the property of CenturyLink and may contain confidential or privileged information.

So, officially, you did not ask anything?  Well, then I'm not going to answer.


But it should be mentioned that SQLite is an _embedded_ database, i.e., it is meant to be part of a program written in a 'real' programming language, so with sqlite3_create_function(), there is no use case for the feature that you did not ask about


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: CREATE FUNCTION

Quan Yong Zhai
In reply to this post by Clemens Ladisch
>From: Rousselot, Richard A
>Sent: 2016年8月23日 22:14
>To: SQLite mailing list
>Subject: Re: [sqlite] CREATE FUNCTION

>Trust, me if I could remove that dumb message I would. :)

There is no such thing as a dumb question.
Packing all the core business logic in SQL language has some advantage,  It’s easier to review and maintain, the database designer define the schema and implement the SQL “procedures”
or “functions” to manipulate the data,. Other programmer just use whatever language they like to call those
procedures, instead of interweave the host language statements and raw SQL statements. It’s more concise,
the complexity of business logic is hidden, the database consistence is easier to preserved.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users