Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
quicksqlconnector
Run MySQL, PostgresSQL, SQLite queries with just one line in python. The Ultimate SQL Library.
Readme
Developers are struggling to execute a query and what if you need to execute another query somewhere else? That's a lot of code to rewrite again. You don't have to do this because QuickSQLConnector got you covered!. Quick SQL Connector is a python library that lets you execute MySQL, PostgreSQL, and SQLite queries with just one line of code.
Reducing 80% lines of code and get more done and it's all done in the same syntax with all SQL databases mentioned.
USING PIP
pip install quicksqlconnector
FOR LINUX FRIENDS
python3 pip install quicksqlconnector
To update Quick SQL Connector to the latest version, add --upgrade flag to the above commands.
from quicksqlconnector import quicksqlconnector
DB = quicksqlconnector('database','host', port, 'username', 'password')
NOTE : If you're using SQLite, you must provide database file name as follows.
DB = quicksqlconnector('sqlite3', database_name='my_example_database')
For database, it has 3 options (case-sensitive).
mysql
sqlite3
postgres
quicksqlconnector only have one method which is 'query'.
DB.query('query','parameters:optional')
FOR SQLite, you don't need to use parameterized quieries as it is not supported in SQLite.
It has two arguments, query and parameters, parameters are optional.
# EXAMPLES FOR 'MYSQL'
DB.query("SELECT * FROM test where id= %s", (input_user,))
DB.query("SELECT * FROM test")
DB.query('CREATE TABLE test(name varchar(10), id int(10))')
DB.query("INSERT INTO test values(%s, %s)", ('harry', 13))
# EXAMPLES FOR 'SQLITE'
DB.query('DROP TABLE movie')
DB.query("CREATE TABLE movie(title varchar(1), year int(1), score int(1))")
# EXAMPLE FOR 'POSTGRESQL'
DB.query('SELECT datname FROM pg_database')
See test.py
for more examples.
Route | Link |
---|---|
Buy me a Coffee | Visit |
Visit | |
PyPi | Visit |
Website | Visit |
FAQs
Run MySQL, PostgresSQL, SQLite queries with just one line in python. The Ultimate SQL Library.
We found that quicksqlconnector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.