Last active
August 29, 2015 14:01
-
-
Save lwzm/46555e54d688d42ab3b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table users( | |
id integer primary key, | |
zone integer not null, | |
user text not null, | |
name text not null, | |
password text default '', | |
born real default 0.0, | |
ban real default 0.0, | |
login real default 0.0, | |
logout real default 0.0, | |
unique(user, zone), | |
unique(name, zone), | |
check(length(name) <= 7) | |
); | |
/* | |
insert into t values(null, 1, 'A1', '*', 'n1', 0,0,0); | |
insert into t values(null, 1, 'A2', '*', 'n1', 0,0,0); -- fail | |
insert into t values(null, 1, 'A2', '*', 'n2', 0,0,0); | |
insert into t values(null, 2, 'A1', '*', 'n1', 0,0,0); | |
insert into t values(null, 2, 'A1', '*', 'n11', 0,0,0); -- fail | |
*/ | |
/* | |
fmt_u = "U{}".format | |
fmt_n = "N{}".format | |
for i in range(10000): | |
for z in range(100): | |
c.execute(cmd, (None, z, fmt_u(i), "********", fmt_n(i), 0,0,0)) | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment