sergegoussev / pysqlc Goto Github PK
View Code? Open in Web Editor NEWSimple python abstraction library for SQL databases
Home Page: https://sergegoussev.github.io/pysqlc/
License: MIT License
Simple python abstraction library for SQL databases
Home Page: https://sergegoussev.github.io/pysqlc/
License: MIT License
db.py
has two unique things: connecting to the db and querying data. These should be separate objects with the db as parent, and another one as child that is inherited
pysqlc does not utilize the SHA2 encryption method. The current connection is made using the legacy mysql native password:
self.conn = mysql.connector.connect(
host=self.login['host'],
user=self.login['username'],
password=self.login['password'],
port=self.login['port'],
charset=self.login['charset'],
database=None,
auth_plugin='mysql_native_password'
)
For now, this gets around the Authentication plugin 'caching_sha2_password' is not supported
error that is sometimes raised when connecting to SHA2 encrypted DB environments.
connect()
method to accept SHA2.For more info, see:
Prior to executing a query, pysqlc validates what type it is so as to not let users use a q_type='SELECT'
(default) when a value insert is required. This is done by simply scanning the inserted sql query for main CRUD commands.
I.e. if any mod_qs = ('update', 'insert', 'replace', 'delete', 'create')
are present, then the user must specify values and the q_type
.
This could create conflict if there is a column being queried in a database that contains any of these columns:
---------------------------------------------------------------------------
QueryError Traceback (most recent call last)
<ipython-input-12-05a69d7a9b1c> in <module>
----> 1 data_community_0 = db.query(q_twts_community_0, q_type="SELECT")
~\Anaconda3\envs\e36\lib\site-packages\pysqlc\db.py in query(self, sql_query, values, q_type, executemany)
68 else:
69 raise QueryError(
---> 70 'improper q_type, please do not use SELECT when modifying data')
71
72
QueryError: improper q_type, please do not use SELECT when modifying data
Fix this potential conflict
Write unit tests to validate that features work properly.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.