+branch/storm

332 by Jamu Kakar
- The README file now includes information about Storm's license,
1
Storm is an Object Relational Mapper for Python developed at
2
Canonical.  API docs, a manual, and a tutorial are available from:
173 by Christopher Armstrong
add a README file describing how to run the tests [trivial]
3
538 by Colin Watson
Chase redirection in README.
4
https://storm.canonical.com/
173 by Christopher Armstrong
add a README file describing how to run the tests [trivial]
5
332 by Jamu Kakar
- The README file now includes information about Storm's license,
6
7
Introduction
8
============
9
10
The project was in development for more than a year for use in
11
Canonical projects such as Launchpad and Landscape before being
12
released as free software on July 9th, 2007.
13
14
Design:
15
16
 * Clean and lightweight API offers a short learning curve and
17
   long-term maintainability.
18
 * Storm is developed in a test-driven manner. An untested line of
19
   code is considered a bug.
20
 * Storm needs no special class constructors, nor imperative base
21
   classes.
22
 * Storm is well designed (different classes have very clear
23
   boundaries, with small and clean public APIs).
24
 * Designed from day one to work both with thin relational
566.1.3 by Colin Watson
Restore MySQL support.
25
   databases, such as SQLite, and big iron systems like PostgreSQL
26
   and MySQL.
332 by Jamu Kakar
- The README file now includes information about Storm's license,
27
 * Storm is easy to debug, since its code is written with a KISS
28
   principle, and thus is easy to understand.
29
 * Designed from day one to work both at the low end, with trivial
30
   small databases, and the high end, with applications accessing
31
   billion row tables and committing to multiple database backends.
32
 * It's very easy to write and support backends for Storm (current
33
   backends have around 100 lines of code).
34
35
Features:
36
37
 * Storm is fast.
38
 * Storm lets you efficiently access and update large datasets by
39
   allowing you to formulate complex queries spanning multiple
40
   tables using Python.
41
 * Storm allows you to fallback to SQL if needed (or if you just
42
   prefer), allowing you to mix "old school" code and ORM code
43
 * Storm handles composed primary keys with ease (no need for
44
   surrogate keys).
45
 * Storm doesn't do schema management, and as a result you're free
46
   to manage the schema as wanted, and creating classes that work
47
   with Storm is clean and simple.
48
 * Storm works very well connecting to several databases and using
49
   the same Python types (or different ones) with all of them.
50
 * Storm can handle obj.attr = <A SQL expression> assignments, when
51
   that's really needed (the expression is executed at INSERT/UPDATE
52
   time).
53
 * Storm handles relationships between objects even before they were
54
   added to a database.
55
 * Storm works well with existing database schemas.
56
 * Storm will flush changes to the database automatically when
57
   needed, so that queries made affect recently modified objects.
58
59
60
License
61
=======
62
554.1.2 by Colin Watson
Add Sphinx documentation.
63
Copyright (C) 2006-2020 Canonical, Ltd.  All contributions must have
332 by Jamu Kakar
- The README file now includes information about Storm's license,
64
copyright assigned to Canonical.
65
66
This library is free software; you can redistribute it and/or
67
modify it under the terms of the GNU Lesser General Public
68
License as published by the Free Software Foundation; either
69
version 2.1 of the License, or (at your option) any later version.
70
71
This library is distributed in the hope that it will be useful,
72
but WITHOUT ANY WARRANTY; without even the implied warranty of
73
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
74
Lesser General Public License for more details.
75
76
You should have received a copy of the GNU Lesser General Public
77
License along with this library; if not, write to the Free Software
78
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
79
02110-1301 USA
80
81
On Ubuntu systems, the complete text of the GNU Lesser General
82
Public Version 2.1 License is in /usr/share/common-licenses/LGPL-2.1
83
84
85
Developing Storm
86
================
87
424.2.10 by David Britton
Adding README note about the dev scripts, non-interactive to ubuntu-deps
88
SHORT VERSION:  If you are running ubuntu, or probably debian, the
89
following should work.  If not, and for reference, the long version
90
is below.
91
92
 $ dev/ubuntu-deps
566.1.3 by Colin Watson
Restore MySQL support.
93
 $ echo "$PWD/** rwk," | sudo tee /etc/apparmor.d/local/usr.sbin.mysqld >/dev/null
94
 $ sudo aa-enforce /usr/sbin/mysqld
424.2.10 by David Britton
Adding README note about the dev scripts, non-interactive to ubuntu-deps
95
 $ make develop
96
 $ make check
97
98
LONG VERSION:
99
332 by Jamu Kakar
- The README file now includes information about Storm's license,
100
The following instructions describe the procedure for setting up a
101
development environment and running the test suite.
102
103
Installing dependencies
104
-----------------------
105
480.2.2 by Alberto Donato
Drop extra space.
106
The following instructions assume that you're using Ubuntu.  The same procedure
107
will probably work without changes on a Debian system and with minimal changes
108
on a non-Debian-based linux distribution.  In order to run the test suite, and
566.1.3 by Colin Watson
Restore MySQL support.
109
exercise all supported backends, you will need to install MySQL and
110
PostgreSQL, along with the related Python database drivers:
332 by Jamu Kakar
- The README file now includes information about Storm's license,
111
415.2.3 by Gavin Panella
Revert r417; MySQLdb-python is not reliably installable from PyPI.
112
 $ sudo apt-get install \
566.1.3 by Colin Watson
Restore MySQL support.
113
       mysql-server \
415.1.33 by Gavin Panella
Merged go-setuptools into oneiric-admin-shutdown-bug-871596, resolving conflicts.
114
       postgresql pgbouncer \
115
       build-essential
332 by Jamu Kakar
- The README file now includes information about Storm's license,
116
566.1.3 by Colin Watson
Restore MySQL support.
117
These will take a few minutes to download.
332 by Jamu Kakar
- The README file now includes information about Storm's license,
118
581.1.1 by Colin Watson
Remove Python 2 support.
119
The Python dependencies for running tests can be installed with apt-get:
415.1.19 by Gavin Panella
Go completely over to the Dark, ahem, setuptools side.
120
415.1.25 by Gavin Panella
Document make develop in README.
121
 $ apt-get install \
581.1.1 by Colin Watson
Remove Python 2 support.
122
       python3-fixtures \
123
       python3-pgbouncer \
124
       python3-psycopg2 \
125
       python3-testresources \
126
       python3-timeline \
127
       python3-transaction \
128
       python3-twisted \
129
       python3-zope.component \
130
       python3-zope.security
415.1.19 by Gavin Panella
Go completely over to the Dark, ahem, setuptools side.
131
415.1.25 by Gavin Panella
Document make develop in README.
132
Alternatively, dependencies can be downloaded as eggs into the current
133
directory with:
134
135
 $ make develop
136
137
This ensures that all dependencies are available, downloading from
138
PyPI as appropriate.
415.1.9 by Gavin Panella
Add instructions for disconnection tests to README.
139
566.1.3 by Colin Watson
Restore MySQL support.
140
Database setup
141
--------------
142
143
Most database setup is done automatically by the test suite.  However,
144
Ubuntu's default MySQL packaging ships an AppArmor profile that prevents it
145
from writing to a local data directory.  To allow the test suite to do this,
146
you will need to grant it access, which is most easily done by adding a line
147
such as this to /etc/apparmor.d/local/usr.sbin.mysqld:
148
149
  /path/to/storm/** rwk,
150
151
Then reload the profile:
152
153
  $ sudo aa-enforce /usr/sbin/mysqld
154
332 by Jamu Kakar
- The README file now includes information about Storm's license,
155
Running the tests
156
-----------------
157
158
Finally, its time to run the tests!  Go into the base directory of
159
the storm branch you want to test, and run:
160
161
 $ make check
162
163
They'll take a while to run.  All tests should pass: failures mean
164
there's a problem with your environment or a bug in Storm.