Re: [sqlite] sqlite4 completion status

2014-01-05 Thread Dan Kennedy

On 01/06/2014 02:27 PM, big stone wrote:

Hello,

Is there a completion status for the sqlite4 project somewhere ? An
estimate Year/Quarter for a first downloadable version ?


Currently there is not.

Dan.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite4 completion status

2014-01-05 Thread big stone
Hello,

Is there a completion status for the sqlite4 project somewhere ? An
estimate Year/Quarter for a first downloadable version ?

I don't find that information in
http://sqlite.org/src4/doc/trunk/www/index.wiki

Regards,
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3session_changeset API oddity

2014-01-05 Thread Dan Kennedy

On 01/05/2014 11:23 PM, Marco Bambini wrote:

I am using sqlite3_changeset API to add undo/redo capabilities to an app.
I record sqlite operations and I store all of them in a sqlite3_session object.

When I need to UNDO an operation I simply do something like:
rc = sqlite3session_changeset(session, &pnChangeset, &ppChangeset);
rc = sqlite3changeset_invert(pnChangeset, ppChangeset, &pnInvertedChangeset, 
&ppInvertedChangeset);
rc = sqlite3changeset_apply (self.db, pnInvertedChangeset, ppInvertedChangeset, 
NULL, fConflict, NULL);

The problem is that I would like to reuse the same session object to perform 
the REDO operation but after executing the UNDO code above, when I call:
rc = sqlite3session_changeset(session, &pnChangeset, &ppChangeset);
pnChangeset is always 0.


sqlite3session_changeset() returns a blob containing the differences
between the current database and the database as it was when the
session object was first attached. After running "UNDO", there are
no differences. Hence the empty changeset.

Dan.



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] RFE: Rename Column

2014-01-05 Thread Simon Slavin

On 5 Jan 2014, at 6:41pm, Petite Abeille  wrote:

> On Jan 5, 2014, at 6:56 PM, Igor Tandetnik  wrote:
> 
>> On 1/4/2014 7:15 PM, Elrond wrote:
>>> Short: Could you implement alter table rename column?
>> 
>> The problem would be, what to do with all the indexes, triggers, views and 
>> foreign keys that reference that column?
> 
> Sure, but that’s an unrelated set of problems, isn’t it? As it stands, one 
> cannot even rename a column.

You're both right.  Igor's statement pretty-much /is/ the reason one cannot 
rename a column.  One would need to write a parser and changer for SQL 
statements that could identify and change column names in many statements with 
all sorts of weird possibilities for formatting.

Two alternatives: (a) actually write the parser-and-changer that processes SQL 
commands, or (b) wait until the major file format changes in SQLite4, then 
change the way SQL stores the CREATE commands needed to construct a database so 
it stores a structured version of the commands instead of the raw text.

The advantage of either change would be that it allows almost all the ALTER 
TABLE commands SQL users expect, not just changing column names.  This 
simplifies life not just for normal users but also for all the writers of 
SQLite GUI managers out there, who have to write nasty risky time-consuming 
hacks if they want to accomplish those operations.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] RFE: Rename Column

2014-01-05 Thread Igor Tandetnik

On 1/5/2014 1:41 PM, Petite Abeille wrote:

On Jan 5, 2014, at 6:56 PM, Igor Tandetnik  wrote:


On 1/4/2014 7:15 PM, Elrond wrote:

Short: Could you implement alter table rename column?


The problem would be, what to do with all the indexes, triggers, views and 
foreign keys that reference that column?


Sure, but that’s an unrelated set of problems, isn’t it? As it stands, one 
cannot even rename a column.


In SQLite, if you update just the CREATE TABLE statement but no other 
parts of the schema, you may easily end up with a database that can't be 
opened at all.



(P.S. Other DBs tend to simply invalidate all the related objects and let the 
user sort it out)


If you are willing to let the user sort it out, then the existing 
mechanism of directly manipulating sqlite_master should suffice.

--
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] RFE: Rename Column

2014-01-05 Thread Petite Abeille

On Jan 5, 2014, at 6:56 PM, Igor Tandetnik  wrote:

> On 1/4/2014 7:15 PM, Elrond wrote:
>> Short: Could you implement alter table rename column?
> 
> The problem would be, what to do with all the indexes, triggers, views and 
> foreign keys that reference that column?

Sure, but that’s an unrelated set of problems, isn’t it? As it stands, one 
cannot even rename a column.

(P.S. Other DBs tend to simply invalidate all the related objects and let the 
user sort it out)

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] RFE: Rename Column

2014-01-05 Thread Igor Tandetnik

On 1/4/2014 7:15 PM, Elrond wrote:

Short: Could you implement alter table rename column?


The problem would be, what to do with all the indexes, triggers, views 
and foreign keys that reference that column? SQLite stores database 
schema as text, in the form of CREATE... statements. I suspect it would 
require heroic efforts to go over all those statements, find all 
occurrences of X (where X is the old name of the column), and filter out 
false positives (cases where X names something else, say a column in a 
different table).

--
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] RFE: Rename Column

2014-01-05 Thread Elrond

Hi everybody,

Short: Could you implement alter table rename column?

I know that sqlite does only support a limited subset of
SQL. Some subsets have only been added lately, like foreign
keys, and can be disabled at compile time to safe space.

Renaming a table is already supported, which is good.

I hope, renaming a column should not be extremely complex.
There are even dangerous recipes out there [1] that
manipulate the internal structure (sqlite_master) using the
public API. So could those recipes be turned into
(hopefully safer) internal code?


Cheers

  Elrond

[1] http://stackoverflow.com/a/6684034/1890086
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite3session_changeset API oddity

2014-01-05 Thread Marco Bambini
I am using sqlite3_changeset API to add undo/redo capabilities to an app.
I record sqlite operations and I store all of them in a sqlite3_session object.

When I need to UNDO an operation I simply do something like:
rc = sqlite3session_changeset(session, &pnChangeset, &ppChangeset);
rc = sqlite3changeset_invert(pnChangeset, ppChangeset, &pnInvertedChangeset, 
&ppInvertedChangeset);
rc = sqlite3changeset_apply (self.db, pnInvertedChangeset, ppInvertedChangeset, 
NULL, fConflict, NULL);

The problem is that I would like to reuse the same session object to perform 
the REDO operation but after executing the UNDO code above, when I call:
rc = sqlite3session_changeset(session, &pnChangeset, &ppChangeset);
pnChangeset is always 0.

Is this a bug or something not correctly documented?
Please let me know.
--
Marco Bambini
http://www.sqlabs.com
http://twitter.com/sqlabs
http://instagram.com/sqlabs



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users