Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assign a name to the database on creation #525

Open
GitterHubber opened this issue Aug 28, 2016 · 0 comments
Open

Assign a name to the database on creation #525

GitterHubber opened this issue Aug 28, 2016 · 0 comments

Comments

@GitterHubber
Copy link

Strata accepts a directory path while creating on attaching to a B-Tree, is it also possible to give a name to the DB on creation.

Also this code that is found on your github page does not seem to create any file in the directory given, I mean it still shows empty.

function createOpenClose (directory, callback) {
    var strata

    create()

    function create () {
        strata = new Strata(directory)
        strata.create(created)
    }

    function created (error) {
        if (error) return callback(error)

        strata.close(reopen)
    }

    function reopen (error) {
        if (error) return callback(error)

        strata = new Strata(directory)
        strata.open(opened)
    }

    function open (error) {
        if (error) return callback(error)

        strata.close(callback)
    }
}

createOpenClose(function (error) { if (error) throw error })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant