Ruslan Talpa
ff2c0b63e2
changed identation to 2 spaces to match the rest of the project
2015-09-25 12:04:44 +03:00
Ruslan Talpa
c42832f1c5
code cleanup
2015-09-25 11:51:37 +03:00
Ruslan Talpa
770e04c04a
remove unused functions in pgstructure
2015-09-25 10:36:19 +03:00
Ruslan Talpa
54d1e4112a
detect primary keys for views & use cached info in PUT/PATCH requests
2015-09-25 10:30:19 +03:00
Ruslan Talpa
89fffd1518
Merge branch 'master' into skin
2015-09-25 10:00:18 +03:00
Ruslan Talpa
8783615ebc
detect primary keys for views ( fix #217 )
2015-09-24 23:30:47 +03:00
Ruslan Talpa
f546dc3ac8
small note about a bug
2015-09-24 22:06:44 +03:00
Ruslan Talpa
f2d6c59bab
fixes for failing tests (only 2 failing, yay! :))
2015-09-24 16:29:20 +03:00
Ruslan Talpa
448a81dff8
first fully functioning build, some tests are failing (limit,order,csv not implemented yet)
2015-09-24 11:45:34 +03:00
Ruslan Talpa
fb92b76a1a
integrated skin code gor generating Sql Query (only left to execute it)
2015-09-23 14:31:24 +03:00
Ruslan Talpa
c0e17c44ba
all tests passing after moving table structure detection at load time
2015-09-23 09:38:40 +03:00
Ruslan Talpa
6f55e1d389
fix for one of the failing tests (acl for tables added)
2015-09-22 18:17:24 +03:00
Ruslan Talpa
a7b883c922
moved db structure detection at the beginning (2 tests failing)
2015-09-22 16:56:19 +03:00
Joe Nelson
35f05f6fe1
Standardize indentation
2015-09-06 16:13:11 -07:00
Joe Nelson
cf2f576ec0
Merge pull request #276 from ruslantalpa/master
...
Support for &select=col1,col2,col3 as suggested in issue #227
2015-09-06 15:24:47 -07:00
Ruslan Talpa
92a1d8c7e3
constrain cast parameters to letters only
2015-09-05 16:54:09 +03:00
Ruslan Talpa
9c8ac2a489
tests for &select= feature and support for casting columns (usefull when extracting subfields from json columns)
2015-09-05 15:05:53 +03:00
Ruslan Talpa
6c16395dfb
change fn name from selectT to select
2015-09-04 19:04:39 +03:00
Ruslan Talpa
40d4fb0d75
Support for extracting fields from json columns
2015-09-02 12:41:02 +03:00
Ruslan Talpa
b9fec2ce41
Support for &select=col1,col2,col3 as suggested in issue #227
2015-09-02 11:03:34 +03:00
Diogo Biazus
89c581816e
Adds */* as a valid media type that will return json [ fix #274 ]
2015-09-01 15:57:59 -04:00
Joe Nelson
1656fb9f57
Let the transaction reset the role and user id for us
2015-08-26 20:49:23 -07:00
Joe Nelson
594327924c
Set role locally in a tx to ensure it is reset after error
2015-08-26 20:49:23 -07:00
Diogo Biazus
32b97ef076
Adds not as a keyword that can optionally be prepended to any operator in a parameter value
2015-08-21 10:33:41 -04:00
Joe Nelson
28f771324d
Nest response JSON more shallowly
2015-08-20 22:14:08 -07:00
Joe Nelson
cf04fbd6ea
Call procedures that return setof, not just text
...
The output is too deeply nested however
2015-08-20 21:52:46 -07:00
Joe Nelson
bb511f0df2
WIP: call stored pprocedures that emit plain text
...
The beginning of #114
2015-08-20 21:52:46 -07:00
Joe Nelson
f564fb0977
Rename QualifiedTable to encompass proc names as well
2015-08-20 21:35:12 -07:00
Diogo Biazus and Joe Nelson
3b017dfdf6
Adds 415 response for any non-empty Accept header different from application/json or text/csv. Uses apropriate Content-Type header when sending CSV format.
2015-08-20 20:47:36 -07:00
Richard Allaway
f16e2e3ee5
adds 'not in' query
2015-08-17 10:24:51 -04:00
Joe Nelson
adac39bd7c
Use Content-Type text/csv for CSV responses
2015-08-15 11:57:57 -07:00
Diogo Biazus
9d5011e864
Implements CSV resnponse for the appropriate accept headers
2015-08-14 11:04:26 -04:00
Diogo Biazus
ca40ba1fda
Refactors app function to DRY header lookups
2015-08-14 11:04:26 -04:00
Joe Nelson
cd6b688f7f
Merge pull request #244 from diogob/adds_materialized_views_to_root
...
Adds materialized views to list of relations in GET / [#242 ]
2015-08-01 16:16:23 -07:00
Diogo Biazus
ab0170ffaf
Adds materialized views to list of relations in GET / [ #242 ]
2015-08-01 01:09:12 -04:00
Diogo Biazus
449cacdacf
Fixes error code 42803 when trying to query a view with a column named count.
2015-08-01 00:15:17 -04:00
MattK
8eae978eae
Enable log capture if stdout is not a terminal
2015-07-24 12:14:18 -04:00
Diogo Biazus
c76864a653
Qualifies columns used in WHERE clauses so we can use computed columns as filters
2015-07-10 12:35:24 -04:00
Diogo Biazus
9c69553373
Verifies PostgreSQL version is supported (+9.2) before spawning server [ fixes #157 ]
2015-07-02 09:26:58 -04:00
Joe Nelson
6604293ac1
Remove regex-tdfa-text to allow building in GHC 7.10
...
Fixes #212
2015-07-01 21:55:35 -07:00
Diogo Biazus
e87be593c0
Removes toBool function as we now cast the 'YES/NO' values to boolean in PostgreSQL's queries
2015-06-22 18:09:45 -04:00
Diogo Biazus
f4011e5d8c
Changes the insertable to true in views that are insertable through triggers [ fixes #206 ]
2015-06-22 00:16:23 -04:00
Federico Rampazzo
83f48dcd15
User_id support (via user_vars)
2015-05-24 03:26:42 +01:00
Diogo Biazus
a980db6d2d
Adds spec for @@ operator and implements it in PgQuery
2015-05-22 12:28:26 -04:00
Sridhar Ratnakumar
c3ad87ffaf
Make postgrest usable as a library
2015-05-19 23:40:39 -07:00
Federico Rampazzo
77aecc9e86
JWT support
2015-05-20 06:01:50 +01:00
Joe Nelson
e35ad0f340
Update changelog, remove debugging
2015-05-12 10:55:51 -07:00
Joe Nelson
709e70561f
Provide more information in PATCH response
...
* 404 if no records updated
* Range header for number updated
* Full results depending on Prefer header
Fixes #187
Fixes #182
2015-05-12 10:47:55 -07:00
João Cristóvão
35d36d95c1
GHC 7.10.1 support
...
Without it, the following error occurs:
```
src/PgStructure.hs:88:5:
Non type-variable argument
in the constraint: Data.String.Conversions.ConvertibleStrings
Text k
(Use FlexibleContexts to permit this)
When checking that ‘addFK’ has the inferred type
addFK :: forall k.
(Ord k, Data.String.Conversions.ConvertibleStrings Text k) =>
Map.Map k ForeignKey -> Column -> Column
In an equation for ‘columns’:
columns table
= do { cols <- H.listEx
$ (\ _1 _2
-> Hasql.Backend.Stmt
"select info.table_schema as schema, info.table_name as table_name, info.column_name as name, info.ordinal_position as position, info.is_nullable as nullable, info.data_type as col_type, info.is_updatable as updatable, info.character_maximum_length as max_len, info.numeric_precision as precision, info.column_default as default_value, array_to_string(enum_info.vals, ',') as enum from ( select table_schema, table_name, column_name, ordinal_position, is_nullable, data_type, is_updatable, character_maximum_length, numeric_precision, column_default, udt_name from information_schema.columns where table_schema = ? and table_name = ? ) as info left outer join ( select n.nspname as s, t.typname as n, array_agg(e.enumlabel ORDER BY e.enumsortorder) as vals from pg_type t join pg_enum e on t.oid = e.enumtypid join pg_catalog.pg_namespace n ON n.oid = t.typnamespace group by s, n ) as enum_info on (info.udt_name = enum_info.n) order by position"
(GHC.ST.runST (do { ... }))
True)
(qtSchema table) (qtName table);
fks <- foreignKeys table;
return $ map (addFK fks . columnFromRow) cols }
where
addFK fks col = col {colFK = Map.lookup (cs . colName $ col) fks}
```
Also, the regex-tdfa-text library needs a similar patch, but I didn't have time to contact the author yet.
Cheers
2015-04-24 16:22:43 +01:00
Joe Nelson
5688030104
Allow posting JSON array and object
...
Fixes #168
Fixes #156
2015-04-19 17:46:11 -07:00