Skip to content

Better Documentation #180

@PeytonHanel

Description

@PeytonHanel

I just started using the Planetscale serverless driver for JavaScript, but I'm having a hard time understanding it. The documentation explains the very basics but doesn't go into detail on any of the return objects to the provided functions, why you would want to use any of the things provided over the other, nor any caveats I should/shouldn't know. All of the provided objects/classes/types in javascript lack JsDocs.

Having detailed documentation is useful so developers can quickly understand how to use the library without having to tinker and try things out. I've provided some examples below that could be improved on, but it's not a comprehensive list.

The docs say that we can connect to our DB with connect and Client, but they don't explain why I would want to use one over the other apart from this line

Use the Client connection factory class to create fresh connections for each transaction or web request handler.

The Client class has a execute function but also has another function called connection which returns a Connection object, which also has an execute function. Why are there two? Are they actually the same? When do I use one over the other?

There's also no mention of pooling, which I'm not even sure matters for serverless, but I feel like it should be addressed so I'm not overloading my DB with connections.

I'm also assuming that parameterized SQL calls won't cause me to have a SQL injection. You have an article here but it doesn't address this library at all.

Etc.

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions