linkcheck.logger.sql

A SQL logger.

Functions

intify(s)

Coerce a truth value to 0/1.

sqlify(s)

Escape special SQL chars and strings.

Classes

SQLLogger(**kwargs)

SQL output, should work with any SQL database (not tested).

class linkcheck.logger.sql.SQLLogger(**kwargs)[source]

Bases: linkcheck.logger._Logger

SQL output, should work with any SQL database (not tested).

Initialize database access data.

comment(s, **args)[source]

Write SQL comment.

end_output(**kwargs)[source]

Write end of checking info as sql comment.

log_url(url_data)[source]

Store url check info into the database.

start_output()[source]

Write start of checking info as sql comment.

LoggerArgs = {'dbname': 'linksdb', 'filename': 'linkchecker-out.sql', 'separator': ';'}
LoggerName = 'sql'
linkcheck.logger.sql.intify(s)[source]

Coerce a truth value to 0/1.

Parameters

s (object) – an object (usually a string)

Returns

1 if object truth value is True, else 0

Return type

number

linkcheck.logger.sql.sqlify(s)[source]

Escape special SQL chars and strings.