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

Allow load_schema() to accept a str #31

Open
kawing-chiu opened this issue Nov 22, 2017 · 1 comment
Open

Allow load_schema() to accept a str #31

kawing-chiu opened this issue Nov 22, 2017 · 1 comment

Comments

@kawing-chiu
Copy link

The current API assumes that schema is saved in a file, but in my case the capnp schema is fetched from some db as a str. Maybe an argument can be add to load_schema() to support this usage?

@colinfang
Copy link
Collaborator

That sounds like a good idea.

If it is implemented we can remove a lot of boilerplate code in tests e.g.

        schema = """
        @0xbf5147cbbecf40c1;
        struct Point {
            x @0 :Int64;
            y @1 :Int64;
        }
        """
        mypkg = self.tmpdir.join("mypkg").ensure(dir=True)
        myschema = mypkg.join("myschema.capnp")
        myschema.write(schema)

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

2 participants