[spambayes-dev] [ spambayes-Patches-756413 ] Add a SQL-based storage class

SourceForge.net noreply at sourceforge.net
Wed Jun 18 17:43:31 EDT 2003

Patches item #756413, was opened at 2003-06-18 16:23
Message generated for change (Comment added) made by anadelonbrin
You can respond by visiting: 

Category: None
Group: None
Status: Open
Resolution: None
Priority: 1
Submitted By: Tony Meyer (anadelonbrin)
Assigned to: Tony Meyer (anadelonbrin)
Summary: Add a SQL-based storage class

Initial Comment:
The attached patches add a SQL based storage class 
that can be used via pop3proxy.  It assumes that the 
user has mySQL and MySQLdb installed, and has already 
set up the table as suggested on the spambayes mailing 

There is a great deal of room for improvement here.  In 
particular, having a separate table for the tokens is 
probably a waste (as discussed somewhat abstractly on 
the list).

If anyone wants an SQL solution, here it is.  This should 
be able to be patched into the current cvs for a 
reasonable while yet.

If you do end up using this, please let the list know.  If a 
suitably large number of people do (at least 2!), then it 
could be checked in to the main code.


>Comment By: Tony Meyer (anadelonbrin)
Date: 2003-06-19 11:43

Logged In: YES 

Is there a diff how-to somewhere?  I looked for one a while 
back, but couldn't find anything (apart from the manual for 
diff itself).  I was just guessing...

The connect call connects to the mySQL server.  The USE 
command just after that connects to the appropriate 
database.  I haven't used mySQLdb much, so I don't know for 
sure this is the correct way to do it, but it did work.

The base class is a good idea.  I'll do this if I ever put this in 
the main code.


Comment By: Skip Montanaro (montanaro)
Date: 2003-06-18 23:54

Logged In: YES 

A couple quick observations without having tried the code:
* the diffs all seem to be reversed and are not context
  diffs, so it will be tough to apply them if the surrounding
  code changes at all

* don't you need to specify a database name in the connect

* maybe it should be called MySQLClassifier to admit other
  SQL implementations later.  For the short term, perhaps
  a dummy SQLClassifier could inherit from classifier.Classifier
  and be the base class for MySQLClassifier.


You can respond by visiting: 

More information about the spambayes-dev mailing list