Giter VIP home page Giter VIP logo

Comments (2)

collerek avatar collerek commented on May 19, 2024 1

Thanks for help @paolodina!

Exactly like @paolodina said @Erhannis you need to create the database if you do not connect to existing one.
For simple use cases migration can be a overkill so method described above should suffice.

Was about to update the Quick Start for some time already so this issue was finally a motivation.
Please check the new/updated quick start at https://collerek.github.io/ormar/ (or in pypi).

Added some info, disclaimers, links, divided all into functional blocks and made it runnable in full.

Hope that helps!

P.S. If you like ormar don't forget to star the repo and spread the news about it - let's build a community around ormar so it's easier to catch bugs and find contributors.

from ormar.

paolodina avatar paolodina commented on May 19, 2024

You should initialize the database before using it.

Indeed the quickstart page didn't say this explicitly, it'd be probably a good idea to add to the quickstart page a link to the "Migrations/Database Initialization" docs, or maybe add the snippet for convenience and the link for details.

You should be all set after:

import sqlalchemy
engine = sqlalchemy.create_engine("sqlite:///test.db")
definition metadata.create_all(engine)

from ormar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.