Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django to snowflake connection and running ORM queries

I am looking to shift out of Postgres to SnowFlake as some of my features require run time analysis which is faster in Snowflake.

I could only get the Python connector API for Snowflake which would require me to create raw queries instead of Djago ORM queries.

Is there anyway we can connect to Snowflake using Django and execute the same Django ORM queries on Snowflake.

I saw this old post How to query this (snow flake) data schema in django

But couldn't find how to set up a django connection with Snowflake.

like image 837
abhiphanse Avatar asked Apr 08 '18 07:04

abhiphanse


People also ask

Does Django support ORM?

One of the most powerful features of Django is its Object-Relational Mapper (ORM), which enables you to interact with your database, like you would with SQL. In fact, Django's ORM is just a pythonical way to create SQL to query and manipulate your database and get results in a pythonic fashion.

What is ORM query in Django?

The object-relational mapper (ORM) in Django makes it easy for developers to be productive without prior working knowledge of databases and SQL. QuerySets represent a collection of objects from the database and can be constructed, filtered, sliced, or generally passed around without actually hitting the database.

Is Django ORM good?

Django's ORM saves developers a lot of time because it allows them to write their data model in a single place, making it easier to update, maintain and reuse code. It also allows for the automatic handling of database schemas. Best of all, your Web Programmers don't have to write SQL.

What is Django ORM called?

Django ORM provides an elegant and powerful way to interact with the database. ORM stands for Object Relational Mapper. It is just a fancy word describing how to access the data stored in the database in Object Oriented fashion. Start Django shell using the shell command.


1 Answers

The snowflake-sqlalchemy package provides connecting from sqlalchemy to Snowflake.

Another python snowflake low-level connector is documented here

I never tried either of them though.

like image 137
Shadi Avatar answered Sep 17 '22 14:09

Shadi