I've read this article more than once and I still find it inspiring...
http://catb.org/~esr/writings/cathedral-bazaar/cathedral-bazaar/ar01s04.html
I'd say, you have the fix, just release it, why not? if you're waiting
for a next bug, you'll never have the guarantee that "tomorrow" no bug
wil
Christian Smith wrote:
You can use the rowid to track the row version, and a unique
constraint on your key to track conflicts. When updating a record,
read the row, including the rowid. Update any columns.
When writing the row out, delete the existing rowid, then insert the
new updated row,
hongdong wrote:
I just have a base question:
assume user A and user B now both connection to a same database and
both of
them want to update a same record,but only one is allowed
in this condition:
A begin to browse the data in a client application,and load rowid into
GUI
and keep it in me
Lloyd wrote:
select a from mytable where (b=0) and
and this is a syntax error.
you're not saying which language you're using.
in Python a common solution looks like this:
clauses = []
# add strings to the clauses list, like
clauses.append('(b=0)')
# join the parts using appropriate glue
wh
[EMAIL PROTECTED] wrote:
In the FAQ's on the web site it indicated that when the primary key is
autoincrement, the data type is a signed 64 bit number. Has this been your
experience?
never noticed... not in Python with the sqlite modules I have... and
no difference whether I use the 'auto
Cécilia Vigny wrote:
With MySQL, it's possible to declare an index in CREATE TABLE, using
KEY, like in this example :
CREATE TABLE table_name (
id int(6) NOT NULL auto_increment,
field_name date default NULL,
PRIMARY KEY (id),
KEY idx_field_name (fieldname),
) ;
I want to know if there
just a few explainatory notes from me to myself, hoping that they might
be useful for the community...
again about integer primary key autoincrement, with some details about
last_insert_rowid() and sqlite_sequence.
---
e
On 11/11/2006 10:16 PM, Will Leshner wrote:
You should be able to get the last inserted rowid using the
last_insert_rowid() function in a query:
SELECT last_insert_rowid();
sorry for the slow reaction, but I had to check my own code first...
On Fri, 28 Jul 2006 16:47:21 +0200, Nemanja Corlij
Gábor Farkas wrote:
i think it should only output the first row ( "5|admin|1|5|1|john" )
tried what you describe and get the answer you expect, not the one you got:
sqlite> select * from role
...> LEFT OUTER JOIN person_role on role.id = person_role.role_id
...> INNER JOIN person on perso
Narendran wrote:
I like to say it properly,
i am deleting ,it does delete. but i am trying to delete again, no error
code is returned,
there is no error...
"""delete from hai where ;"""
means:
delete all records from table hai for which the test is true.
doing the same delete a second ti
Andrea Federico Grisotto wrote:
*fromId* and *toId* are VARCHAR, if I use *int* the behavior is correct,
excuse me again, but remain the difference behavior between sqlite
and Mysql.
just food for thought: when you're asking an ambiguous question (like in
the case of comparing apples with p
Sergio 'OKreZ' Agosti wrote:
On 05/set/06, at 15:03, eWobbuh wrote:
I still cant find it. Cant find anything about where to look for a
database. [...]
The name of the database passed to the open function actually is the
path to the database file
yes, where maybe we could add that sqlit
eWobbuh wrote:
Havent try it yet, just wondering if its possible. Do you know how you tell
sqlite where to find a database? havent worked before with it.. only with
mysql
http://www.sqlite.org contains a link to 'documentation'.
the very impatient reader will follow 'sqlite in 5 minutes or l
eWobbuh wrote:
here a sqlite noob. Is it possible in linux to have a sqlite database on a
usb stick which i can acces from an hard disk? On the hard disk runs linux
with sqlite.
have you already tried? I don't think there should be any problems,
except possibly regarding the performance...
Rob Sciuk wrote:
On Wed, 30 Aug 2006, Mario Frasca wrote:
I understand your concern about legacy programs, but most of us expect
PRIMARY KEY to imply NOT NULL... don't we?
I have to go along with Mario, here. This is a potential show stopper,
I would not be that negative
Dixon Hutchinson wrote:
I have not reach a point of creating a "maximum possible ROWID", I'm
only at three rows.
it's a matter of definition... if you just reached three rows, without
deletions, then the maximum rowid is 3.
If I actually specify AUTOINCREMENT, then an insert will fail w
Dixon Hutchinson wrote:
H:\b>sqlite3.exe t.dat
SQLite version 3.3.7
Enter ".help" for instructions
sqlite> CREATE TABLE abc
...> (
...> c TEXT,
...> p INTEGER,
...> t TEXT,
...> masked INTEGER PRIMARY KEY,
...>
Dixon Hutchinson wrote:
[...] I was hoping to get the behavior specified at
http://www.sqlite.org/autoinc.html. where the AUTOINCREMENT keyword is
not used.
but you are getting quite exactly what is stated there:
«If you ever delete rows or if you ever create a row with the maximum
possibl
On 2006-0829 13:15:02, [EMAIL PROTECTED] wrote:
To my surprise (perhaps "horror") I find that SQLite has
for a very long time allowed NULL values in PRIMARY KEY
columns. [...]
I understand your concern about legacy programs, but most of us expect PRIMARY
KEY to imply NOT NULL... don't we
Mario Frasca wrote:
Kurt Welgehausen wrote:
[...] should I write a bug ticket
about a primary key accepting nulls?
there is already a ticket for that: 518. I reopened it three days ago.
I have right now attached a patch for it. it is quite small and I hope
it fits in the current style
Kurt Welgehausen wrote:
[EMAIL PROTECTED] wrote:
Saying NOT NULL on a PRIMARY KEY is redundant, by the way.
[...]
Am I missing something, or should I write a bug ticket
about a primary key accepting nulls?
there is already a ticket for that: 518. I reopened it three days ago.
reg
I'm recording this behaviour:
sqlite> create table test(f integer primary key autoincrement, v integer
default 0);
sqlite> insert into test(f) values(NULL);
sqlite> insert into test(f) values(NULL);
sqlite> insert into test(f) values(NULL);
sqlite> select * from test;
1|0
2|0
3|0
this is very
Joe Wilson wrote:
--- [EMAIL PROTECTED] wrote:
SQLite accepts the above and does the right thing with it.
It is the equivalent of saying:
SELECT a FROM (SELECT a,b FROM qqq GROUP BY b);
Not sure what you mean by the "right thing". It's not obvious
why the rows returned by this GROUP BY
Nemanja Corlija wrote:
I think in any other case unique index would be created as expected.
sqlite> drop table test;
sqlite> create table test (ni integer, pk_name varchar(32) primary key,
info integer);
sqlite> pragma index_list(test);
0|sqlite_autoindex_test_1|1
sqlite> pragma table_info(t
Nemanja Corlija wrote:
If you turn the headers on (.header ON) you'll see that the last
column of table_info() output is "pk".
This column indicates weather or not the table column in question is
part of primary key.
Though that last column of table_info() pragma is missing from
documentation
hallo, list...
how do I get primary key information about a table?
[EMAIL PROTECTED]:~$ sqlite3 /data/mariof/test.db
SQLite version 3.3.6
Enter ".help" for instructions
sqlite> drop table test;
sqlite> create table test (pk integer primary key, name varchar(32),
info integer);
sqlite> create u
Kees Nuyt wrote:
Will
PRAGMA table_info(tablename);
do?
>>> from pysqlite2 import dbapi2
>>> db = dbapi2.connect('/data/mariof/test.db')
>>> cr = db.cursor()
>>> cr.execute('pragma table_info(test3)')
>>> cr.fetchall()
[(0, u'd', u'date', 0, None, 0),
(1, u'h', u'time', 0, None, 0),
(2, u't'
[EMAIL PROTECTED] wrote:
Adding DATE and TIMEINTERVAL types to SQLite would require an
incompatible file format change.
well, yes, that was already clear. but: where is the type of the data
being stored? aren't there a few spare bits to use for 'future
additions', that is, new data types?
Nuno Lucas wrote:
You need to get the column declared type and convert it to the type
you want based on that.
mmm... so I would look at it in a statically typed way. it sounds
reasonable and is surely acceptable for me. but: how do I get the
declared type of the column? currently the pyt
Dennis Cote wrote:
Mario Frasca wrote:
where I would expect:
sqlite> select datetime('now');
2006-08-03 11:36:32.211032
sqlite> select typeof(datetime('now'));
datetime
sqlite> select datetime('now') - date('2006-01-01');
214 11:36:51.29
are there any plans to support more data types than NULL, INTEGER, REAL,
TEXT, BLOB? in particular I am interested in support of: DATE,
DATETIME, TIMEDELTA.
I tried the datetime functions, but:
sqlite> select datetime('now');
2006-08-03 11:36:32
sqlite> select typeof(datetime('now'));
text
sql
Mario Frasca wrote:
I'm throwing this here, I assume that it would not be too much work to
complete this patch. the aim is to support the sql92 syntax insert
into default values;
all right, a possible complete patch, maybe could be added to the
rest... don't tell me that it loo
just to show that it does not crash:
sqlite> create table test2 (k integer primary key autoincrement);
sqlite> insert into test2 default values;
sqlite> insert into test2 () values ();
sqlite> select * from test2;
1
2
sqlite>
I refined the patch. it constructs a list of values with one NULL, but
I don't see how to construct an idList with just the primary key.
also added the grammar rule to recognize both:
insert into default values;
insert into () values ();
anybody completing/correcting the work?
sqlite> ins
I'm throwing this here, I assume that it would not be too much work to
complete this patch. the aim is to support the sql92 syntax insert into
default values;
any comments? hints?
thanks in advance,
Mario Frasca.
cvs diff: Diffing src
Index: src/ins
On 2006-0728 16:47:21, Nemanja Corlija wrote:
> You can get that with this query:
> select seq from sqlite_sequence where name='test' [...]
>
> There is also a last_insert_rowid() [...]
> sqlite_sequence is really the way to go.
very useful comments from everybody,
thanks!
Mario
--
Power c
On 2006-0728 16:07:47, Nemanja Corlija wrote:
> You can insert default value like this:
> insert into test (f) values (NULL);
>
> Inserting NULL into autoincrement field just increments it. While
> omitting value for any other field uses default for that field, if one
> is defined.
next question
On 2006-0728 07:05:54, Gerry Snyder wrote:
> sqlite> insert into test (f) values (NULL);
> sqlite> select * from test;
> 1|1
> 2|2
> 3|
> 4|0
I'm sorry, I did not see the message before...
it is a bit of a funny behaviour, but I think I can live with it...
thanks again,
Mario
--
Never, under a
Hi Gerry, yes, your help was quite useful...
now we have two problems here, I would say:
the first one is that, of all the things you have tried, only one is
correct but two more are accepted without causing an error.
On 2006-0728 06:55:22, Gerry Snyder wrote:
> sqlite> create table test(f int a
ror
sqlite> insert into test () values ();
SQL error: near ")": syntax error
actually, missing auto_increment and sequences, inserting an 'all default'
record is just a style exercise, not really particularly useful...
thanks,
Mario Frasca
--
Die Welt wird nicht bedroht von den Menschen, die böse sind, sondern
von denen, die das Böse zulassen
-- Albert Einstein
40 matches
Mail list logo