Skip to content

Generating types in python format #795

Open
@dhruvmalik007

Description

@dhruvmalik007

Is your feature request related to a problem? Please describe.

I was following the tutorial for generating the database types for supabase here , so I thought normally this command can be adapted for the python in order to generate the corresponding types in python objects

Describe the solution you'd like

to include the command

npx supabase gen types python --project-id "$PROJECT_REF" --schema public > types.py should generate the types in the python.

Describe alternatives you've considered
converting the types generated in ts into py ;) .
Additional context
N.A

Activity

sweatybridge

sweatybridge commented on Jul 24, 2024

@sweatybridge
Contributor

Type generation is handled mostly in https://github.com/supabase/postgres-meta/tree/master/src/server/templates where you can see a list of supported type templates.

If you would like to contribute a new language, we will be more than happy to review your PR.

transferred this issue fromsupabase/clion Jul 24, 2024
Mohmn

Mohmn commented on Jul 25, 2024

@Mohmn

Could you please assign this issue to me? I find it very interesting t. Also, could you guide me on anything I need to know to get started? Any specific instructions or resources would be greatly appreciated

dhruvmalik007

dhruvmalik007 commented on Jul 26, 2024

@dhruvmalik007
Author

thanks @Mohmn for the response . my bad for late response but yeah I understood we will have to define the generator types and the wrapped call functions in order to pythonic format.

but yeah right now I have my plate full in terms of time dedication , so if you want to contribute please feel free to do that.

TopIvanAbramov

TopIvanAbramov commented on Sep 10, 2024

@TopIvanAbramov

Generating types in Python will be really helpfull

faroukcharkas

faroukcharkas commented on Sep 15, 2024

@faroukcharkas

python types would actually be incredible, having a built in almost-ORM? with supabase would be wild

urieltfk

urieltfk commented on Sep 26, 2024

@urieltfk

Please, this would be amazing.

antopiahk

antopiahk commented on Sep 26, 2024

@antopiahk

Please, this would be beyond amazing.

nikita-olechko

nikita-olechko commented on Sep 29, 2024

@nikita-olechko

Wrote a small implementation for Python here:

https://github.com/nikita-olechko/Supabase-Table-Type-Definitions-In-Python/blob/main/README.md

Far from comprehensive, but works.

ryanpeach

ryanpeach commented on Oct 1, 2024

@ryanpeach

Here is my suggestion for the output format #808

I don't think it will be hard to modify the go file to do this for python.

tresorama

tresorama commented on Dec 12, 2024

@tresorama

Any updates on this ?

As of today which is the recommended path to convert TS types (generated with supabase cli) into python types ?
Recommended Libraries to use ?

ryanpeach

ryanpeach commented on Dec 12, 2024

@ryanpeach

If it could get testing guidance on my PR I'd continue my work.

tresorama

tresorama commented on Dec 12, 2024

@tresorama

If it could get testing guidance on my PR I'd continue my work.

You pr would add a new command to supabase cli ?

ryanpeach

ryanpeach commented on Dec 12, 2024

@ryanpeach

No it just adds Python type generation.

tresorama

tresorama commented on Dec 12, 2024

@tresorama

No it just adds Python type generation.

So it's a standalone script .py ?

11 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      Generating types in python format · Issue #795 · supabase/postgres-meta