bbdd-utils 0.3.13__py3-none-any.whl → 0.3.14__py3-none-any.whl
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/utils.py +4 -2
- {bbdd_utils-0.3.13.dist-info → bbdd_utils-0.3.14.dist-info}/METADATA +1 -1
- bbdd_utils-0.3.14.dist-info/RECORD +7 -0
- bbdd_utils-0.3.13.dist-info/RECORD +0 -7
- {bbdd_utils-0.3.13.dist-info → bbdd_utils-0.3.14.dist-info}/WHEEL +0 -0
- {bbdd_utils-0.3.13.dist-info → bbdd_utils-0.3.14.dist-info}/licenses/LICENSE +0 -0
- {bbdd_utils-0.3.13.dist-info → bbdd_utils-0.3.14.dist-info}/top_level.txt +0 -0
bbdd_utils/utils.py
CHANGED
@@ -18,7 +18,9 @@ def Conector_bbdd(tipo='sqlite', nombre='mi_base_de_datos', host='localhost', pu
|
|
18
18
|
import os
|
19
19
|
nombre_db = f"{nombre}.db"
|
20
20
|
conn = sqlite3.connect(nombre_db)
|
21
|
+
print(f"Base de datos SQLite '{nombre_db}' creada exitosamente.")
|
21
22
|
return conn
|
23
|
+
|
22
24
|
|
23
25
|
elif tipo == 'mysql':
|
24
26
|
import mysql.connector
|
@@ -30,7 +32,7 @@ def Conector_bbdd(tipo='sqlite', nombre='mi_base_de_datos', host='localhost', pu
|
|
30
32
|
# Crear la base de datos
|
31
33
|
cursor = conn.cursor()
|
32
34
|
cursor.execute(f"CREATE DATABASE IF NOT EXISTS {nombre}")
|
33
|
-
print(f"Base de datos '{nombre}' creada exitosamente.")
|
35
|
+
print(f"Base de datos Mysql '{nombre}' creada exitosamente.")
|
34
36
|
return conn
|
35
37
|
|
36
38
|
elif tipo == 'mongodb':
|
@@ -41,7 +43,7 @@ def Conector_bbdd(tipo='sqlite', nombre='mi_base_de_datos', host='localhost', pu
|
|
41
43
|
port=puerto,
|
42
44
|
username=usuario,
|
43
45
|
password=password)
|
44
|
-
print("
|
46
|
+
print(f"Conexión exitosa a MongoDB en {host}:{puerto}.")
|
45
47
|
return cliente[nombre]
|
46
48
|
|
47
49
|
else:
|
@@ -0,0 +1,7 @@
|
|
1
|
+
bbdd_utils/__init__.py,sha256=mjRX7GqWkOJq66KqghZ4MZE0Aai6R89LPeu1mjq4lD4,121
|
2
|
+
bbdd_utils/utils.py,sha256=BAXSgYIGr4p9SmyuV6J-VdyLpz8MFTP9V8MRpbW8Dko,5364
|
3
|
+
bbdd_utils-0.3.14.dist-info/licenses/LICENSE,sha256=D4uqg6QX0fapLNcdUznOuGaRIUPnypOdeE2zIyYq7xY,217
|
4
|
+
bbdd_utils-0.3.14.dist-info/METADATA,sha256=jQvbtqrCUH7m-8PVQzqoudqGXVut6Xz-fCUligS7AmQ,694
|
5
|
+
bbdd_utils-0.3.14.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
6
|
+
bbdd_utils-0.3.14.dist-info/top_level.txt,sha256=bBGkVkxnOw7tZ2zRcyCM3lgVgYo1hFbcmwkGdKAj9Gk,11
|
7
|
+
bbdd_utils-0.3.14.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
bbdd_utils/__init__.py,sha256=mjRX7GqWkOJq66KqghZ4MZE0Aai6R89LPeu1mjq4lD4,121
|
2
|
-
bbdd_utils/utils.py,sha256=eDco-IZrcw-vgzvAo6r9KMTrQ2YGC4IDRokR5A8yPjc,5244
|
3
|
-
bbdd_utils-0.3.13.dist-info/licenses/LICENSE,sha256=D4uqg6QX0fapLNcdUznOuGaRIUPnypOdeE2zIyYq7xY,217
|
4
|
-
bbdd_utils-0.3.13.dist-info/METADATA,sha256=oiJ2Lk6tBq-PWaC-ndrTJiHno-a8fCYFIqq-khqJAjI,694
|
5
|
-
bbdd_utils-0.3.13.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
6
|
-
bbdd_utils-0.3.13.dist-info/top_level.txt,sha256=bBGkVkxnOw7tZ2zRcyCM3lgVgYo1hFbcmwkGdKAj9Gk,11
|
7
|
-
bbdd_utils-0.3.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|