Overview
| Comment: | fixed dump restoration (NULL fields) |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | master | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
b16bc5d76f47fdf05c0d325e79ce6f6e |
| User & Date: | c.kworr@d4daf22a-8aaf-11de-a64d-234b64dd91b4 on 2010-03-25 15:56:45.000 |
| Other Links: | branch diff | manifest | tags |
Context
|
2010-07-14
| ||
| 13:50 | * removed unneeded check on rules * added possibility to specify masks check-in: 1fa8a88371 user: c.kworr@d4daf22a-8aaf-11de-a64d-234b64dd91b4 tags: master, trunk | |
|
2010-03-25
| ||
| 15:56 | fixed dump restoration (NULL fields) check-in: b16bc5d76f user: c.kworr@d4daf22a-8aaf-11de-a64d-234b64dd91b4 tags: master, trunk | |
|
2010-03-22
| ||
| 15:32 | added sorting by site check-in: c27c7eb208 user: c.kworr@d4daf22a-8aaf-11de-a64d-234b64dd91b4 tags: master, trunk | |
Changes
Modified database.sql
from [bb384fd21a]
to [54fb4b1bc2].
| ︙ | ︙ | |||
132 133 134 135 136 137 138 | -- this function adds tag to domain CREATE or replace FUNCTION mark(domain text, new_tag text) RETURNS integer LANGUAGE sql immutable STRICT AS $$ select mark(get_site($1), $2) as result; $$; | | | | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | -- this function adds tag to domain CREATE or replace FUNCTION mark(domain text, new_tag text) RETURNS integer LANGUAGE sql immutable STRICT AS $$ select mark(get_site($1), $2) as result; $$; -- this function sets tags for site without regexp CREATE or replace FUNCTION set(my_id_site integer, my_id_tag integer) RETURNS integer LANGUAGE sql STRICT AS $$ delete from urls where $1 = id_site and regexp is NULL; insert into urls (id_site, id_tag) values ($1, $2); select $1; $$; -- this function sets tags for site/regexp pair CREATE or replace FUNCTION set(my_id_site integer, my_id_tag integer, my_regexp text) RETURNS integer LANGUAGE sql STRICT |
| ︙ | ︙ |
Modified st-load.py
from [02168859d1]
to [b93af38ecd].
| ︙ | ︙ | |||
35 36 37 38 39 40 41 | config['user'], config['password'], config['host'], config['database'], ) ) def load(self, csv_data): | < > > > > > | | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
config['user'],
config['password'],
config['host'],
config['database'],
) )
def load(self, csv_data):
with self._db.xact():
config.section('loader')
if config['drop_database']:
self._db.execute('delete from urls;')
if config['drop_site']:
self._db.execute('delete from site;');
insertreg = self._db.prepare("select set($1, $2, $3)")
insert = self._db.prepare("select set($1, $2)")
for row in csv_data:
if len(row[2]) > 0:
insertreg(row[0], row[1], row[2])
else:
insert(row[0], row[1])
self._db.execute('vacuum analyze site;')
self._db.execute('vacuum analyze urls;')
# this classes processes config file and substitutes default values
class Config:
__slots__ = frozenset(['_config', '_default', '_section'])
_default = {
|
| ︙ | ︙ |