Commit Graph

218 Commits

Author SHA1 Message Date
Daniel Perez 2adfd70bb5 Add examples for join. 2015-05-13 14:20:20 +09:00
Nguyen Dang Minh a4a29d6025 Update README.md
The line:
// db := gorm.Open("postgres", dbSql)
should be
// db, _ := gorm.Open("postgres", dbSql)
2015-05-02 16:19:54 +07:00
nicholasf a9aef2dd90 Simpler (and correct) example for showing how to declare foreign keys.
Impact: Trivial.
2015-04-22 12:54:19 -07:00
Jinzhu 3c2915a9df Add Nested Preloading to README 2015-04-22 15:38:22 +08:00
Jinzhu d61af54b96 Add default model struct 2015-04-13 10:09:00 +08:00
Eduardo Trujillo 640700d391 Add an example with time 2015-04-03 23:08:35 -04:00
Jinzhu 03966a1e20 Merge pull request #436 from jaytaylor/master
FoundationDB dialect integration
2015-03-30 14:55:50 +08:00
Jinzhu 14620058ed Merge pull request #438 from jaytaylor/jay/update-columns-skip-associations
Skip saving associations during UpdateColumns(...)
2015-03-30 14:44:41 +08:00
Tim Kluge 3bd7cab8d6 Fix type of OwnerType in polymorphism example 2015-03-29 20:47:35 +02:00
Jay Taylor ab48cd222a `UpdateColumns(...)` no longer triggers save of associated records. 2015-03-28 14:15:12 -07:00
Jay Taylor dcc06e22f7 FoundationDB dialect layer and compatibility updates. 2015-03-24 10:35:19 -07:00
Jinzhu b0cf9a9e4b Add Composite Primary Key example 2015-03-11 17:40:54 +08:00
Jinzhu a549b6bd49 Refactor SQL Tag 2015-03-11 17:05:58 +08:00
Jinzhu 7b9272a15e Update README 2015-03-11 11:15:23 +08:00
Jinzhu 6fed43162f Create Indexes with AutoMigrate 2015-03-09 17:22:16 +08:00
Jinzhu 34997385b0 Add HasIndex method for dialect interface 2015-03-02 23:02:40 +08:00
Jinzhu 1521b794d8 Update README 2015-02-24 22:06:42 +08:00
Jinzhu d22cd2e9d7 Update README 2015-02-24 17:11:35 +08:00
Jinzhu 5c478b46e1 Use Common Initialisms from golint 2015-02-18 10:36:32 +08:00
Jinzhu 6dc33d6d94 Merge pull request #360 from sendyhalim/scope-add-foreignkey
Add Scope.addForeignKey()
2015-02-11 19:35:57 +08:00
Jinzhu 0ea51c1e1f Update README for Preload 2015-02-11 19:27:58 +08:00
Jinzhu f97e2c088e Make Preload works with has_one, has_many, belongs_to relations 2015-02-11 17:17:27 +08:00
Jinzhu 3b784c37c4 First try for the Preload feature 2015-02-11 09:47:10 +08:00
Sendy Halim d861d8737e Update README.md 2015-02-07 18:08:25 +07:00
Solomon White b7c6c6af13 Update README.md
fix typo.  :)
2015-01-22 10:43:47 -07:00
Jinzhu 1b4490fd47 Add MIT License file 2015-01-05 08:59:18 +08:00
jnfeinstein 7e8c0f7edd Add README.md updates for polymorphism. 2014-11-25 21:27:08 -08:00
jnfeinstein 1d6b59f223 Allow .Open to reuse existing database connections.
This commit allows you to pass a string or an existing database
connection as the source for gorm. The dialect is still required
because a) there is no common reference to it as far as i know, and
b) gorm allows the dialect to differ from the driver. So, for the sake
of simplicity, you still have to specity the dialect.

This is useful if you have an existing transaction, but still
want to use gorm to format your queries.

This is dependent on the defintion of DB in pkg database/sql having
the field 'dsn', which is the database source, obtained via reflect.
2014-11-25 15:21:28 +08:00
Weston Platter e56f82e256 readme. add wrecker master branch badge to readme. 2014-11-23 21:38:57 -07:00
jnfeinstein 429a100856 Add additional methods of specifying the 'select' portion of a query.
This commit adds more ways of specifying selects:

-) You can now pass in a []string.  This is mostly for convenience,
since you may want to dynamically create a list of fields to be
selected.

-) You can now use variables.  This is important because a select
could take user input.  For example, finding a MAX between a record
and a given number could be easily done using select, and then
you don't have to process anything in backend logic.  This is also
necessary to use postgres text search capabilities (which actaully
play nicely with the rest of gorm).

-) You can now chain select calls.  This could be useful in
conjunction with gorm's scopes functionality.
2014-11-17 07:36:26 -05:00
Jinzhu 75819b2bb3 Refactor DefaultValue 2014-11-17 17:38:32 +08:00
Paolo Galeone 064d91335b Add default values support ( https://github.com/jinzhu/gorm/issues/251 ) 2014-11-15 18:32:35 +01:00
Jinzhu 48930b60eb Fix spelling error in README 2014-10-28 17:01:05 +08:00
arianitu 716e682394 Update README.md
Make the connection string for MySQL more obvious.
2014-10-11 21:40:10 -04:00
Jinzhu 0aaefebf4f Add support for custom column names 2014-10-07 22:37:33 +08:00
ehabit bdadbb5c6f Fixed typo on line 196, changed works to work.
Fixed typo on line 196, changed works to work.
2014-09-27 15:35:18 -07:00
Jinzhu 938c09e702 Merge pull request #222 from jaytaylor/readme-cleanup
README cleanup: Consistent comment prefixing `////` for raw SQL example output.
2014-09-16 11:02:25 +08:00
Jay Taylor 1c4339c2e9 Tabified code sample indentation. 2014-09-15 17:59:04 -07:00
Jinzhu 88858a942e Update README 2014-09-12 16:40:55 +08:00
Jay Taylor 189a7ef561 Restored original commenting for 3 lines. 2014-09-06 22:55:50 -07:00
Jay Taylor 250de0376b README cleanup: Consistent comment prefixing `////` for raw SQL example output. 2014-09-06 15:55:42 -07:00
Tim Schaub 09d3c5dff0 Match case from above 2014-09-05 15:00:26 -06:00
Jinzhu 204356b320 Update README 2014-08-30 23:24:09 +08:00
Long Nguyen 4fa2faf64c Fixed spelling error 2014-08-27 12:56:25 -04:00
Jinzhu 9012c9ea09 Add Set, Get method for DB 2014-08-20 16:25:01 +08:00
Jinzhu 14fdbdd965 AutoMigrate accepts structs 2014-08-20 11:56:39 +08:00
Shirou WAKAYAMA b4fc3d9753 add document about DropTableIfExists. 2014-08-05 23:16:22 +09:00
Jinzhu df4a00a945 Update README with Associations 2014-07-30 22:50:27 +08:00
Jinzhu 0c63e57f5c Use tag to set primary key 2014-07-29 18:21:36 +08:00
Jinzhu 11bfaba497 Update README 2014-07-18 15:43:01 +08:00
Vytautas Šaltenis 3587dbee4d Fix link to section in README
It seems to be case sensitive, change tableName -> tablename.
2014-07-12 13:37:58 +03:00
Jinzhu bdaecff30d Update README 2014-07-09 10:18:07 +08:00
Jinzhu 8be30beee9 Fix typo in README 2014-06-13 10:54:37 +08:00
Vladimir Garvardt d2e526bc2d db.Create() for force insert with predefined primary key 2014-06-12 00:51:43 +04:00
Jinzhu 744cb7dfda Update README 2014-06-05 18:23:22 +08:00
Vladimir Garvardt d1dc0ccbef AddUniqueIndex 2014-06-01 02:35:56 +04:00
Vladimir Garvardt cdce84fd1a AddIndex for multiple columns 2014-06-01 02:26:17 +04:00
Jinzhu 3264b82368 Fix auto migration for sqlite 2014-04-29 15:39:06 +08:00
Benjamin Ruston 14ea47c280 fix minor grammar issues and broken header link in README.md 2014-04-19 13:04:56 +01:00
Duke 98e9670b8e fixed example code 2014-04-10 03:49:00 -03:00
Paolo Galeone bcb1ca67c0 Add support for primary key different from id 2014-04-06 04:10:45 +02:00
Jinzhu 65e594e2d6 Fix README 2014-03-15 09:05:08 +08:00
Jinzhu 6bb7c8b744 Add callback.go 2014-01-23 16:43:39 +08:00
Lee Brooks 1019783c90 Added installation note to the docs 2014-01-05 15:07:50 +02:00
Jinzhu 68bb65d942 temporary remove codebot, Will add it back when gorm's tests could be run in its box 2014-01-04 14:28:36 +08:00
Jinzhu 13302ba410 Add Joins support 2014-01-04 14:23:55 +08:00
Jinzhu d64f4825d7 Add Codebot 2014-01-04 13:38:41 +08:00
Jinzhu 4125526ef6 Improve Logger 2014-01-03 19:23:41 +08:00
Jinzhu 09c26cb387 Merge pull request #43 from leebrooks0/master
Added a note to the docs that Gorm uses reflection to know which tables ...
2014-01-03 02:25:07 -08:00
Jinzhu 8010616e89 Add method Raw and Scan 2014-01-03 18:14:51 +08:00
Lee Brooks 37abd81de2 Added a note to the docs that Gorm uses reflection to know which tables to work with 2014-01-03 11:26:50 +02:00
Jinzhu 3e24b14906 Update TODO 2014-01-03 14:54:47 +08:00
Lee Brooks 4203bc15c6 Made some small improvements to the documentation 2014-01-02 19:27:41 +02:00
Jinzhu dd77ca6df7 Add AfterFind callback 2013-12-30 12:47:29 +08:00
Trevor Rosen f3b09997d2 Fix typo in docs
* Use '.' to bring exported identifiers into main namespace (not '_')
2013-12-27 18:50:26 -06:00
Trevor Rosen 09334a8bb7 Remove typo from DB access example in README 2013-12-27 16:09:43 -06:00
Jinzhu e2f8d29d7f Add RecordNotFound tests for method Related 2013-12-23 21:15:09 +08:00
Jinzhu 90a4581a7f Use method DB() to get database connection handle 2013-12-04 14:29:44 +08:00
haoxin c37227346c Update README.md 2013-11-29 09:33:59 +08:00
Jinzhu 81a44f0283 Convert Tab to Spaces in README 2013-11-26 11:39:07 +08:00
Jinzhu 0e2bef7006 Add Method RecordNotFound() 2013-11-24 11:29:37 +08:00
Jinzhu 31c64a9c95 Transaction in callbacks 2013-11-24 08:31:44 +08:00
Jinzhu 660ee1ed73 Add Method NewRecord 2013-11-23 21:38:31 +08:00
Jinzhu 87f493d080 Add Scopes Support 2013-11-18 14:35:44 +08:00
Jinzhu 1a2eef181a Add Method UpdateColumn, UpdateColumns 2013-11-17 21:44:11 +08:00
Jinzhu 5411291173 Rename UpdateColumn to ModifyColumn 2013-11-17 20:38:43 +08:00
Jinzhu c62568c089 Make Exec possible to accepts arguments 2013-11-17 16:47:39 +08:00
Jinzhu b41f2957fb Add method Group, Having 2013-11-17 13:29:01 +08:00
Jinzhu 282b5d872c Document Row & Rows 2013-11-17 12:09:40 +08:00
Jinzhu 094a546815 Update README 2013-11-17 12:02:22 +08:00
Jinzhu 9a1c0d956d cache snake, upper values 2013-11-17 08:28:30 +08:00
Jinzhu 8fd8604a70 Support use variable to keep query chain 2013-11-16 22:42:00 +08:00
Jinzhu 52fd87c57b Define some error codes 2013-11-15 18:36:39 +08:00
Jinzhu 5a02c2ec27 Update README 2013-11-15 17:37:21 +08:00
Jinzhu 4e1e2a0fbb Update README 2013-11-15 17:27:16 +08:00
Jinzhu c1c13129f1 Finish dialects 2013-11-14 19:09:27 +08:00
Jinzhu c03999a44e Add Tag Support 2013-11-14 00:03:31 +08:00
Jinzhu 6b31a9a41f Use MIT License 2013-11-12 07:14:28 +08:00
Jinzhu 788da015d1 Clean up code 2013-11-11 21:57:29 +08:00
Jinzhu 23db784911 Update TODO 2013-11-11 19:46:04 +08:00