ADDED: NOTEDB::binary. so now 0.8 is ready for shipping !

FIXED:          regexp bug fixed. It was only possible to delete 2 items together
                separated by comma ("d 1,2,3,4" deleted only 1,2!).
ADDED:          Some new config options which reflects the new module structure.
                So you can change your database backend without the need to
                replace the note script itself.
FIXED:          the previously added feature "cd <topic>" didn't really work :-(
ADDED:          NOTEDB::mysql added. Perlmodule, which I will use within
                note from now on instead of buildin functions for accessing the
                database. From now on I only need to maintain one version of
                note, since the module interface will be identical between the
                bin and sql version.
CHANGED:        The SQL code does not use Mysql.pm anymore. Instead it is coded
                using the more portable DBI module. This allows one easily to
                switch to anther database, which is supported by DBI.
CHANGED:        Locking. The db-table will now be locked before note accesses it.
FIXED:          width of listings is now always the same independent of the string-
                length of a certain note.
This commit is contained in:
TLINDEN
2012-02-10 20:12:25 +01:00
parent 1ab897790c
commit f54d187c47
14 changed files with 2086 additions and 96 deletions

62
mysql/README Normal file
View File

@@ -0,0 +1,62 @@
README for the mysql database installation for note
Requirements
============
You need the following things:
o perl installed (5.004x)
o mysql database installed and running
o Mysql perlmodule (you can find it on
http://www.mysql.org) PLEASE NOTE:
It needs the Module "Mysql". The install.sh
script will install it for you directly from
CPAN if you like. Newer versions
are DBI, which you can also use to access
mysql databases. If you want to use it, you
have to rewrite the program. Please let me
know, if you did it :-)
o permissions to create a new database and
to write data to this database.
Installation
============
First, make sure all these things above are ok.
You can use the script "install.sh" to create a new
database and the table structure. You might edit
the script before running it.
If you are getting trouble, i.e. if you have not the
required permissions to do that, please make sure,
you can.
As user root, you have to give your user the
neccessary permissions. Please refer to the mysql
documentation, how to do that.
After that repeat the step above.
You can find a sample config file within the subdirectory
"config" named noterc. There are some special values
which you can use to connect to a different database
then the default.
install.sh will create the following database:
name: user_note
Maintable: note
Number: number(int 10)
Note: note(text)
Date: date(text)
You can use the file "permissions" as a template for
modifying a users permissions to her database. Please
note, that there are different version of mysql out
there with different access privilege systems, which
are not compatible, refer to the documentation shipped
with your mysql installation to learn, how many fields
are available and what they are for.
You may also take a look to:
http://www.mysql.org/Manual_chapter/manual_Privilege_system.html
This should be all.

33
mysql/install.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/sh
# installs note
# This is the installer for the mysql version only!
echo "Welcome to note `cat VERSION` installation."
echo "the install script will ask you a view questions,"
echo "make sure to answer them correctly!"
echo
/bin/echo -n "creating the note database..."
NAME="_note"
DBNAME="$USER$NAME"
echo "DBNAME=$DBNAME"
mysqladmin create $DBNAME
echo "done."
/bin/echo -n "creating the table structure using defaults..."
mysql $DBNAME < sql
echo "Shall I try to install the required MySQL driver from CPAN?"
read YESNO
case $YESNO in
"y" | "Y")
if [ $UID != 0 ] ; then
echo "You should be root for that!"
exit
fi
perl -MCPAN -e shell cpan> install mysql
;;
esac
echo "done."

2
mysql/permissions Normal file
View File

@@ -0,0 +1,2 @@
insert into user values
('localhost','','','Y','Y','Y','Y','Y','Y','N','N','N','N','N','N','N','Y');

8
mysql/sql Normal file
View File

@@ -0,0 +1,8 @@
CREATE TABLE note (
number int(10) DEFAULT '0' NOT NULL auto_increment,
note text,
date text,
PRIMARY KEY (number)
);
# sample grant statement:
#GRANT ALL PRIVILEGES ON tom_note TO tom@localhost IDENTIFIED BY 'password';