From 374770930cff5bfa72a95db0ee5394a74b7cc775 Mon Sep 17 00:00:00 2001
From: lisasmah <lisa.smah@developpemnt-durable.gouv.fr>
Date: Mon, 20 Jan 2025 14:24:46 +0100
Subject: [PATCH] =?UTF-8?q?Correction=20de=20la=20gestion=20des=20tables?=
 =?UTF-8?q?=20non=20g=C3=A9o=20dans=20importer=5Fdata=20-=20Ajout=20d'une?=
 =?UTF-8?q?=20ligne=20pour=20d=C3=A9finir=20explicitement=20`query=5Fsql?=
 =?UTF-8?q?=5Flimit`=20dans=20la=20fonction=20importer=5Fdata.=20-=20Passa?=
 =?UTF-8?q?ge=20=C3=A0=20la=20version=200.0.0.9009=20dans=20DESCRIPTION.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 DESCRIPTION  | 2 +-
 NEWS.md      | 4 ++++
 R/get_data.R | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 7e0b5f6..f2c0227 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,6 +1,6 @@
 Package: datalibaba
 Title: Interface De Connexion a Une Base Posgres Postgis
-Version: 0.0.0.9008
+Version: 0.0.0.9009
 Authors@R: 
     c(person(given = "Maël",
              family = "Theulière",
diff --git a/NEWS.md b/NEWS.md
index 3172aab..71b3529 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,7 @@
+## datalibaba 0.0.0.9009
+- Gestion des tables non géo dans la fonction `importer_data` : Ajoute d'une ligne pour définir explicitement `query_sql_limit` dans la fonction importer_data (cas table non géo).
+
+
 # datalibaba 0.0.0.9008
 - Ajout d'un paramètre booleen `ecoSQL` à la fonction `connect_to_db` pour switcher de driver (passage du `DBI::dbDriver("PostgreSQL")` si `EcoSQL = FALSE`, à `RPostgres::Postgres()` si `ecoSQL = TRUE` adapté à l'usage de l'offre d'hébergement de base EcoSQL)
 
diff --git a/R/get_data.R b/R/get_data.R
index 0f4b142..cda2932 100644
--- a/R/get_data.R
+++ b/R/get_data.R
@@ -85,6 +85,7 @@ importer_data <- function(table = NULL, schema = NULL, db  = "public", server =
     if(limit == 0) {
       data <- DBI::dbReadTable(con, name)
     } else {
+      query_sql_limit <- paste0("SELECT * FROM ", schema, ".", table, " LIMIT ", limit)
       data <- DBI::dbGetQuery(con, query_sql_limit)
       }
 
-- 
GitLab