You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by smithsz <gi...@git.apache.org> on 2015/09/21 17:11:36 UTC

[GitHub] couchdb-fabric pull request: Check if a DB exists prior to creatin...

GitHub user smithsz opened a pull request:

    https://github.com/apache/couchdb-fabric/pull/30

    Check if a DB exists prior to creating

    COUCHDB-2819

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/smithsz/couchdb-fabric 2819-db-create-check-already-exists

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-fabric/pull/30.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #30
    
----
commit a9b77c071ea2280a036e8fe14e3e678d46ed1744
Author: Sam Smith <sa...@cloudant.com>
Date:   2015-09-21T15:05:16Z

    Check if a DB exists prior to creating
    
    COUCHDB-2819

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fabric pull request: Check if a DB exists prior to creatin...

Posted by smithsz <gi...@git.apache.org>.
Github user smithsz commented on a diff in the pull request:

    https://github.com/apache/couchdb-fabric/pull/30#discussion_r39996557
  
    --- Diff: src/fabric_db_create.erl ---
    @@ -155,3 +160,10 @@ make_document([#shard{dbname=DbName}|_] = Shards, Suffix) ->
             {<<"by_range">>, {[{K,lists:sort(V)} || {K,V} <- ByRangeOut]}}
         ]}}.
     
    +check_db_doc_exists(DbName) ->
    --- End diff --
    
    righto, I'll rename to db_exist and return true | false.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fabric pull request: Check if a DB exists prior to creatin...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/couchdb-fabric/pull/30


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fabric pull request: Check if a DB exists prior to creatin...

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on the pull request:

    https://github.com/apache/couchdb-fabric/pull/30#issuecomment-142279052
  
    +1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fabric pull request: Check if a DB exists prior to creatin...

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on a diff in the pull request:

    https://github.com/apache/couchdb-fabric/pull/30#discussion_r39982917
  
    --- Diff: src/fabric_db_create.erl ---
    @@ -155,3 +160,10 @@ make_document([#shard{dbname=DbName}|_] = Shards, Suffix) ->
             {<<"by_range">>, {[{K,lists:sort(V)} || {K,V} <- ByRangeOut]}}
         ]}}.
     
    +check_db_doc_exists(DbName) ->
    --- End diff --
    
    The only valid response on `something exists` question is `true` or `false`. I think here will be better to name function as `db_doc_status` that makes `ok | missing` response valid.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fabric pull request: Check if a DB exists prior to creatin...

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on a diff in the pull request:

    https://github.com/apache/couchdb-fabric/pull/30#discussion_r39985109
  
    --- Diff: src/fabric_db_create.erl ---
    @@ -155,3 +160,10 @@ make_document([#shard{dbname=DbName}|_] = Shards, Suffix) ->
             {<<"by_range">>, {[{K,lists:sort(V)} || {K,V} <- ByRangeOut]}}
         ]}}.
     
    +check_db_doc_exists(DbName) ->
    --- End diff --
    
    Yeah, agree. db_exist(DbName) returning true | false.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fabric pull request: Check if a DB exists prior to creatin...

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on a diff in the pull request:

    https://github.com/apache/couchdb-fabric/pull/30#discussion_r40079998
  
    --- Diff: src/fabric_db_create.erl ---
    @@ -155,3 +160,41 @@ make_document([#shard{dbname=DbName}|_] = Shards, Suffix) ->
             {<<"by_range">>, {[{K,lists:sort(V)} || {K,V} <- ByRangeOut]}}
         ]}}.
     
    +db_exist(DbName) ->
    --- End diff --
    
    `db_exists(DbName) ->
        is_list(catch mem3:shards(DbName)).`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fabric pull request: Check if a DB exists prior to creatin...

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on a diff in the pull request:

    https://github.com/apache/couchdb-fabric/pull/30#discussion_r39985938
  
    --- Diff: src/fabric_db_create.erl ---
    @@ -155,3 +160,10 @@ make_document([#shard{dbname=DbName}|_] = Shards, Suffix) ->
             {<<"by_range">>, {[{K,lists:sort(V)} || {K,V} <- ByRangeOut]}}
         ]}}.
     
    +check_db_doc_exists(DbName) ->
    --- End diff --
    
    Also good.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fabric pull request: Check if a DB exists prior to creatin...

Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on the pull request:

    https://github.com/apache/couchdb-fabric/pull/30#issuecomment-142276689
  
    @smithsz : rename function to db_exists and squash please.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fabric pull request: Check if a DB exists prior to creatin...

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on the pull request:

    https://github.com/apache/couchdb-fabric/pull/30#issuecomment-142012729
  
    Can we have a test for this change?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---