Joyce Chen
ab6655d679
Let binary expressions (e.g. boolean AND, OR, =, or arithmetic +, -, ...) be composable
12 years ago
Joyce Chen
55b9c0c664
Add SQL arithmetic operators as binaryMethods
12 years ago
Di Wu
9281093a5e
moving readme-examples.js file
12 years ago
Di Wu
e6ea2016fe
fix spacing in comments
12 years ago
Di Wu
0dea29827b
address all jshint issues
12 years ago
Brian Carlson
fcd21053b8
Fix toQuery() on subquery column
12 years ago
thadclay
f5467bedf8
Add support for SUM and AVG aggregate functions
12 years ago
Sascha Depold
2da1b22cc8
another test for charset and engine
12 years ago
Sascha Depold
79a3cc2504
charset support
12 years ago
Sascha Depold
155eb2bafb
allow definition of mysql engine
12 years ago
Sascha Depold
9b1f54233b
allow silent add column
12 years ago
Sascha Depold
402b759f58
added support for min and max queries
12 years ago
tmont
8fb83185c2
added special 'property' field to columns
When defining a column, you can specify a "property" field
that will allow a more programmer-friendly name to be used
when selecting fields.
e.g.
var user = sql.define({
name: 'user',
columns: [{ state: 'state_or_province', property: 'state' }]
});
user.select(user.state);
12 years ago
bmc
c0d813ee72
Update readme example to be valid
12 years ago
Sascha Depold
8646cd9071
Revert "support ifExists and ifNotExists for index#create / index#drop"
This reverts commit f71207edb9
.
12 years ago
Sascha Depold
f71207edb9
support ifExists and ifNotExists for index#create / index#drop
12 years ago
Sascha Depold
eb8afaf88c
fixed syntax of index creation
12 years ago
Sascha Depold
f894d445bd
allow multiple calls of on for index creation
12 years ago
Sascha Depold
7d4b4a7cec
added support for dropping indexes
12 years ago
Sascha Depold
b9942f77af
support for fulltext and spatial indexes
12 years ago
Andrey Popp
39a3e86f30
Table::select() creates *-select by default
Test case provided.
12 years ago
Sascha Depold
f09e93118a
make sure that the generated index name is correctly sorted
12 years ago
Sascha Depold
0093f98edb
throw an error if no columns have been passed to index creation
12 years ago
Sascha Depold
e652985af2
added test for index creation without custom name
12 years ago
Sascha Depold
2d80c3941a
test for sqlite
12 years ago
Sascha Depold
60a52dc91e
creating indexes is now based on chaining
12 years ago
Sascha Depold
d61bdaebed
create on indexes
12 years ago
Sascha Depold
0bd0ee7207
added methods for reading indexes
12 years ago
Brian Carlson
2b010dd7be
Auto-join based on column information
for usage please see test/dialects/join-to-tests.js
12 years ago
Brian Carlson
aa1c09887a
Allow hash of columns as well as an array
allows table definition like this:
var table = sql.define({
name: 'blah',
columns: {
id: { primaryKey: true, type: 'serial' },
email: { type: 'text' }
}
});
12 years ago
Brian Carlson
3a78b26162
Fix expected query statement in test
12 years ago
Sascha Depold
d8d970c3a7
added failing test for renameColumn
12 years ago
Gorgi Kosev
eb7fd2ce7f
fix multi-field object in where clause bug
When a multi-field object is passed to a where clause, all
fields except the first one were being ignored. This commit
fixes the bug.
12 years ago
Sascha Depold
d1d97deb7f
added shorthand form of getColumn => get
12 years ago
Sascha Depold
f3bc8d2790
- added createColumn that transforms input into a column
- added hasColumn that checks if there is already a column with a certain name
- use hasColumn everywhere
12 years ago
Sascha Depold
669e1c433a
formatting
12 years ago
Sascha Depold
eda540a4a1
allow dynamical definition of columns
12 years ago
Brian Carlson
09c9b89cd9
Add support for table.column.toQuery()
Add tests to support the behavior.
12 years ago
Sascha Depold
ef9aee41ad
added possibility to chain from statements
12 years ago
bmc
951a55b76a
Allow chainable selects
12 years ago
Brian Carlson
f5b6961301
Add 'NOT LIKE' support
12 years ago
Brian Carlson
275488d8fe
Add count().distinct() to columns
12 years ago
Brian Carlson
a9a8a9983b
Add support for DISTINCT
usage: `users.select(users.email.distinct())`
12 years ago
Brian Carlson
5b3954585f
Add ability to call #where with multiple arguments
Initial work on buliding a more complex and feature-full
where clause builder
12 years ago
Brian Carlson
31ef80aeb9
Use mocha instead of weird 1/2 of tap for tests
I kept having to scroll back several hundered lines when a test
would fail and the output was ridiculously verbose.
12 years ago
Brian Carlson
a093b4c07c
Add 'toQuery' to the prototype of all nodes
This allows doing something like this:
`user.join(photos).toQuery().text`
to build just a part of a query.
12 years ago
Brian Carlson
d8027b0a5c
Allow non-query nodes to be turned into strings
12 years ago
Chaoran Yang
bcf08b79c7
Add rename clause for alter table
12 years ago
Casey Foster
270d7fb925
LIMIT and OFFSET can accept a subQuery
12 years ago
Eric Sessoms
c32b00b99b
added more tests of clause ordering
12 years ago