-
Notifications
You must be signed in to change notification settings - Fork 0
Corrección entrega #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: base
Are you sure you want to change the base?
Changes from all commits
1e12a1e
a3e45ce
5bf3ea0
7b6ea4f
843b20d
0d54ccd
dd10719
e95a50c
f82a03c
3ef9b03
eb6b1ab
60303a8
0278963
3b926b9
0cae027
ca2c8b3
c9d6c91
1c77e0e
ee3f61f
263a2c8
a221054
5a646c3
8d5f95f
3fbee8f
ce6233d
b4b8100
9c66d65
b3c9dd3
340a2e4
10a6eb9
b3e2356
7b43d07
44cbb4d
4f4f859
d9ad324
e301324
138ef5c
3b89427
2071be1
aa0fdf9
d7f777d
06310b0
8928e5b
d2f1578
c92afb3
eff4e51
85ca0a8
a429960
3c0ce52
be1e888
a48de5b
e7124f2
086e989
1101661
e38b423
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /target |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| [package] | ||
| name = "tp_individual_taller_9508" | ||
| version = "0.1.0" | ||
| edition = "2021" | ||
|
|
||
| [dependencies] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # tp-individual-taller-95.08 | ||
| repo xa el tp individual | ||
|
|
||
| Crear un nuevo proyecto: cargo new | ||
|
|
||
| I Crear un nuevo proyecto en un directorio existente: cargo init | ||
| (basta con ejecutarlo estando parado en ese directorio) | ||
|
|
||
| I Compilar el proyecto: cargo build | ||
|
|
||
| I Compilar el proyecto en modo release: cargo build –-release | ||
|
|
||
| I Ejecutar el proyecto: cargo run | ||
|
|
||
| I Ejecutar los tests: cargo test | ||
|
|
||
| I Generar la documentación HTML: cargo doc | ||
|
|
||
| I Analizar el proyecto, sin compilar: cargo check | ||
|
|
||
| I Formatear el código: cargo fmt | ||
|
|
||
| I linter: cargo clippy |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| InvalidTable: Ocurrio un error al procesar la tabla. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| //! Módulo para gestionar la ejecución de comandos SQL. | ||
| //! | ||
| //! Este módulo define un `enum` llamado `Comando` que puede representar operaciones SQL de tipo `SELECT`, `INSERT`, `UPDATE` y `DELETE`. | ||
| //! También proporciona métodos para ejecutar estos comandos y para imprimir los resultados de una consulta `SELECT`. | ||
| use crate::delete::Delete; | ||
| use crate::errores::SqlError; | ||
| use crate::insert::Insert; | ||
| use crate::select::Select; | ||
| use crate::update::Update; | ||
|
|
||
| /// Enum que representa los diferentes comandos SQL soportados. | ||
| pub enum Comando { | ||
| Select(Select), | ||
| Insert(Insert), | ||
| Update(Update), | ||
| Delete(Delete), | ||
| } | ||
|
|
||
| impl Comando { | ||
| pub fn ejecutar(&self, ruta_carpeta: &str) -> Result<Vec<Vec<String>>, SqlError> { | ||
| match self { | ||
| Comando::Select(select) => select.ejecutar(ruta_carpeta), | ||
| Comando::Update(update) => update.ejecutar(ruta_carpeta), | ||
| Comando::Insert(insert) => insert.ejecutar(ruta_carpeta), | ||
| Comando::Delete(delete) => delete.ejecutar(ruta_carpeta), | ||
| } | ||
| } | ||
| /// Imprime los resultados de una consulta `SELECT`. | ||
| /// | ||
| /// Esta función imprime los resultados de una consulta si el comando es un `Select`. Para otros tipos de comando (`Insert`, `Update`, `Delete`), | ||
| /// la función no hace mnada | ||
| /// | ||
| /// # Parámetros | ||
| /// | ||
| /// - `results`: Una referencia a un vector de vectores de `String` que contiene los resultados de la consulta. | ||
| pub fn imprimir_resultados(&self, results: &[Vec<String>]) { | ||
| match self { | ||
| Comando::Select(_select) => Select::imprimir_resultados(results), | ||
| Comando::Update(_update) => { | ||
| //nadaaa | ||
| } | ||
| // } | ||
| Comando::Insert(_insert) => { | ||
| // nadaaa | ||
| } | ||
| Comando::Delete(_delete) => { | ||
| // nadaaa | ||
| } | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no hace falta poner en los 3 algo vacío, podes poner