Name | bettermssql JSON |
Version |
0.0.2
JSON |
| download |
home_page | None |
Summary | A simple and lightweight ORM that facilitate some operations on SQL Server using of pyodbc. |
upload_time | 2024-06-12 13:52:56 |
maintainer | None |
docs_url | None |
author | matgasp |
requires_python | >=3.9 |
license | None |
keywords |
better
better mssql
bettermssql
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# **About**
A simple and lightweight ORM that facilitate some operations on SQL Server using of pyodbc.
# How to use
## **Preparation**
```python
# Single call it once to setup the inner settings
BetterMSSQL.setup("name of the database", "db user", "db password", "host", 1234) #port
# Creating a DB Model
class Fruits():
_table = "fruit_table_name"
class People():
_table = "people_table_name"
```
## **Select**
```python
# Select the first fruit ordered by name and retrieve the first row
Fruits().select("name").order("name").row() # returns one row
# Select all data from the top 15 fruits
Fruits().select("*").top("15").run() # returns a row list
# Select all data from the top 15 fruits
Fruits().select("*").top("15").run() # returns a row list
# Select the name of the first person with 34 years old
People().select("name").where("age = ?").cell(34) # returns the first cell of the first row
```
## **Insert**
```python
# Inserting a person given its name and age
People().insert("name, age").run(["Matt", 34])
```
## **Update**
```python
# Updating all ages to 16 where the name is Matt
People().update("age = ?").where("name = ?").run([16, "Matt"])
```
## **Delete**
```python
# Delete all people
People().delete()
```
Raw data
{
"_id": null,
"home_page": null,
"name": "bettermssql",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "better, better mssql, bettermssql",
"author": "matgasp",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/8f/f3/f00161e97053d4ad835ca99ce683400a5c8de93426e348706f81a625974f/bettermssql-0.0.2.tar.gz",
"platform": null,
"description": "# **About**\n\nA simple and lightweight ORM that facilitate some operations on SQL Server using of pyodbc.\n\n# How to use\n\n## **Preparation**\n\n```python\n# Single call it once to setup the inner settings\nBetterMSSQL.setup(\"name of the database\", \"db user\", \"db password\", \"host\", 1234) #port\n\n# Creating a DB Model\nclass Fruits():\n _table = \"fruit_table_name\"\n\nclass People():\n _table = \"people_table_name\"\n```\n\n## **Select**\n\n```python\n# Select the first fruit ordered by name and retrieve the first row\nFruits().select(\"name\").order(\"name\").row() # returns one row\n\n# Select all data from the top 15 fruits\nFruits().select(\"*\").top(\"15\").run() # returns a row list\n\n# Select all data from the top 15 fruits\nFruits().select(\"*\").top(\"15\").run() # returns a row list\n\n# Select the name of the first person with 34 years old\nPeople().select(\"name\").where(\"age = ?\").cell(34) # returns the first cell of the first row\n```\n\n## **Insert**\n\n```python\n# Inserting a person given its name and age\nPeople().insert(\"name, age\").run([\"Matt\", 34])\n```\n\n## **Update**\n\n```python\n# Updating all ages to 16 where the name is Matt\nPeople().update(\"age = ?\").where(\"name = ?\").run([16, \"Matt\"])\n```\n\n## **Delete**\n\n```python\n# Delete all people\nPeople().delete()\n```\n\n",
"bugtrack_url": null,
"license": null,
"summary": "A simple and lightweight ORM that facilitate some operations on SQL Server using of pyodbc.",
"version": "0.0.2",
"project_urls": {
"Issues": "https://github.com/matgasp/bettermssql/issues",
"Repository": "https://github.com/matgasp/bettermssql"
},
"split_keywords": [
"better",
" better mssql",
" bettermssql"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e05c18a023f3bbd0d4ed4ce83b0976e3602dd0feee345123c77ac0a7dee7f56e",
"md5": "4b045e9d859a032fe47aa1c8b05d7c3f",
"sha256": "04f8366a37d68f868b9406d38c35a06e0ae9589b9e100c955125a2cc935de9a6"
},
"downloads": -1,
"filename": "bettermssql-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4b045e9d859a032fe47aa1c8b05d7c3f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 3766,
"upload_time": "2024-06-12T13:52:55",
"upload_time_iso_8601": "2024-06-12T13:52:55.360661Z",
"url": "https://files.pythonhosted.org/packages/e0/5c/18a023f3bbd0d4ed4ce83b0976e3602dd0feee345123c77ac0a7dee7f56e/bettermssql-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8ff3f00161e97053d4ad835ca99ce683400a5c8de93426e348706f81a625974f",
"md5": "00f93a478cf304b0f45e7c7068b25107",
"sha256": "794f14c13bdb395d8d6a35062072a3413b16d112622ec64f20766aeca36b1519"
},
"downloads": -1,
"filename": "bettermssql-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "00f93a478cf304b0f45e7c7068b25107",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 3513,
"upload_time": "2024-06-12T13:52:56",
"upload_time_iso_8601": "2024-06-12T13:52:56.629392Z",
"url": "https://files.pythonhosted.org/packages/8f/f3/f00161e97053d4ad835ca99ce683400a5c8de93426e348706f81a625974f/bettermssql-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-12 13:52:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "matgasp",
"github_project": "bettermssql",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "bettermssql"
}