bbdd-utils 0.3.5__tar.gz → 0.3.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bbdd_utils-0.3.5 → bbdd_utils-0.3.7}/PKG-INFO +2 -2
- {bbdd_utils-0.3.5 → bbdd_utils-0.3.7}/bbdd_utils/utils.py +7 -3
- {bbdd_utils-0.3.5 → bbdd_utils-0.3.7}/bbdd_utils.egg-info/PKG-INFO +2 -2
- {bbdd_utils-0.3.5 → bbdd_utils-0.3.7}/setup.py +2 -2
- {bbdd_utils-0.3.5 → bbdd_utils-0.3.7}/LICENSE +0 -0
- {bbdd_utils-0.3.5 → bbdd_utils-0.3.7}/README.md +0 -0
- {bbdd_utils-0.3.5 → bbdd_utils-0.3.7}/bbdd_utils/__init__.py +0 -0
- {bbdd_utils-0.3.5 → bbdd_utils-0.3.7}/bbdd_utils.egg-info/SOURCES.txt +0 -0
- {bbdd_utils-0.3.5 → bbdd_utils-0.3.7}/bbdd_utils.egg-info/dependency_links.txt +0 -0
- {bbdd_utils-0.3.5 → bbdd_utils-0.3.7}/bbdd_utils.egg-info/top_level.txt +0 -0
- {bbdd_utils-0.3.5 → bbdd_utils-0.3.7}/pyproject.toml +0 -0
- {bbdd_utils-0.3.5 → bbdd_utils-0.3.7}/setup.cfg +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: bbdd_utils
|
3
|
-
Version: 0.3.
|
4
|
-
Summary:
|
3
|
+
Version: 0.3.7
|
4
|
+
Summary: insertar datos en una base de datos SQL o NoSQL
|
5
5
|
Author: Luis_J_Domingo
|
6
6
|
Description-Content-Type: text/markdown
|
7
7
|
License-File: LICENSE
|
@@ -76,6 +76,10 @@ def Cerrar_conexion(conn):
|
|
76
76
|
|
77
77
|
def Insert(conn, data):
|
78
78
|
# Verifica el tipo de base de datos con la que estamos trabajando
|
79
|
+
import sqlite3
|
80
|
+
from mysql.connector.connection import MySQLConnection
|
81
|
+
from pymongo.database import Database
|
82
|
+
############# SQLite ################
|
79
83
|
if isinstance(conn, sqlite3.Connection):
|
80
84
|
print("Conexión exitosa a la base de datos SQL.")
|
81
85
|
# Si estamos usando SQLite, podemos trabajar con la conexión de esta manera
|
@@ -90,7 +94,8 @@ def Insert(conn, data):
|
|
90
94
|
resultados = cursor.fetchall()
|
91
95
|
for fila in resultados:
|
92
96
|
print(f"ID: {fila[0]}, Nombre: {fila[1]}, Edad: {fila[2]}")
|
93
|
-
|
97
|
+
|
98
|
+
############# MySQL ################
|
94
99
|
elif isinstance(conn, mysql.connector.connection.MySQLConnection):
|
95
100
|
print("Conexión exitosa a la base de datos MySQL.")
|
96
101
|
# Si estamos usando MySQL, podemos trabajar con la conexión de esta manera
|
@@ -106,8 +111,7 @@ def Insert(conn, data):
|
|
106
111
|
for fila in resultados:
|
107
112
|
print(f"ID: {fila[0]}, Nombre: {fila[1]}, Edad: {fila[2]}")
|
108
113
|
|
109
|
-
|
110
|
-
|
114
|
+
############# MongoDB ################
|
111
115
|
elif isinstance(conn, Database):
|
112
116
|
print("Conexión exitosa a la base de datos NoSQL.")
|
113
117
|
print(conn)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: bbdd_utils
|
3
|
-
Version: 0.3.
|
4
|
-
Summary:
|
3
|
+
Version: 0.3.7
|
4
|
+
Summary: insertar datos en una base de datos SQL o NoSQL
|
5
5
|
Author: Luis_J_Domingo
|
6
6
|
Description-Content-Type: text/markdown
|
7
7
|
License-File: LICENSE
|
@@ -2,11 +2,11 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name='bbdd_utils',
|
5
|
-
version='0.3.
|
5
|
+
version='0.3.7',
|
6
6
|
packages=find_packages(),
|
7
7
|
install_requires=[],
|
8
8
|
author='Luis_J_Domingo',
|
9
|
-
description='
|
9
|
+
description='insertar datos en una base de datos SQL o NoSQL',
|
10
10
|
long_description=open('README.md').read(),
|
11
11
|
long_description_content_type='text/markdown',
|
12
12
|
# url='https://github.com/tuusuario/milibreria', # si usas GitHub
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|