mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 10:36:00 +02:00
Feature cleanup (#7182)
Following up on #7180 with some feature cleanup: - Move the `database` feature from `plugin` to `default` - Rename the `database` feature to `sqlite` - Remove `--features=extra` from a lot of scripts etc. - No need to specify this, the `extra` feature is now the same as the default feature set - Remove the now-redundant 2nd Ubuntu test run
This commit is contained in:
@ -148,7 +148,7 @@ trash-support = ["trash"]
|
||||
which-support = ["which"]
|
||||
plugin = ["nu-parser/plugin"]
|
||||
dataframe = ["polars", "num", "sqlparser"]
|
||||
database = ["rusqlite"] # TODO: given that rusqlite is included in reedline, should we just always include it?
|
||||
sqlite = ["rusqlite"] # TODO: given that rusqlite is included in reedline, should we just always include it?
|
||||
|
||||
[build-dependencies]
|
||||
shadow-rs = { version = "0.16.1", default-features = false }
|
||||
|
@ -193,7 +193,7 @@ fn features_enabled() -> Vec<String> {
|
||||
names.push("trash".to_string());
|
||||
}
|
||||
|
||||
#[cfg(feature = "database")]
|
||||
#[cfg(feature = "sqlite")]
|
||||
{
|
||||
names.push("database".to_string());
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ pub fn create_default_context() -> EngineState {
|
||||
|
||||
// Database-related
|
||||
// Adds all related commands to query databases
|
||||
#[cfg(feature = "database")]
|
||||
#[cfg(feature = "sqlite")]
|
||||
add_database_decls(&mut working_set);
|
||||
|
||||
// Core
|
||||
|
@ -7,10 +7,10 @@ use nu_protocol::{
|
||||
};
|
||||
use std::io::BufReader;
|
||||
|
||||
#[cfg(feature = "database")]
|
||||
#[cfg(feature = "sqlite")]
|
||||
use crate::database::SQLiteDatabase;
|
||||
|
||||
#[cfg(feature = "database")]
|
||||
#[cfg(feature = "sqlite")]
|
||||
use nu_protocol::IntoPipelineData;
|
||||
|
||||
#[cfg(unix)]
|
||||
@ -107,7 +107,7 @@ impl Command for Open {
|
||||
Vec::new(),
|
||||
))
|
||||
} else {
|
||||
#[cfg(feature = "database")]
|
||||
#[cfg(feature = "sqlite")]
|
||||
if !raw {
|
||||
let res = SQLiteDatabase::try_from_path(path, arg_span)
|
||||
.map(|db| db.into_value(call.head).into_pipeline_data());
|
||||
|
@ -62,8 +62,8 @@ mod dataframe;
|
||||
#[cfg(feature = "dataframe")]
|
||||
pub use dataframe::*;
|
||||
|
||||
#[cfg(feature = "database")]
|
||||
#[cfg(feature = "sqlite")]
|
||||
mod database;
|
||||
|
||||
#[cfg(feature = "database")]
|
||||
#[cfg(feature = "sqlite")]
|
||||
pub use database::*;
|
||||
|
@ -53,7 +53,7 @@ mod path;
|
||||
mod platform;
|
||||
mod prepend;
|
||||
mod print;
|
||||
#[cfg(feature = "database")]
|
||||
#[cfg(feature = "sqlite")]
|
||||
mod query;
|
||||
mod random;
|
||||
mod range;
|
||||
|
@ -108,7 +108,7 @@ fn parses_more_bson_complexity() {
|
||||
// │ 4 │ │
|
||||
// ╰───┴──────╯
|
||||
|
||||
#[cfg(feature = "database")]
|
||||
#[cfg(feature = "sqlite")]
|
||||
#[test]
|
||||
fn parses_sqlite() {
|
||||
let actual = nu!(
|
||||
@ -123,7 +123,7 @@ fn parses_sqlite() {
|
||||
assert_eq!(actual.out, "3");
|
||||
}
|
||||
|
||||
#[cfg(feature = "database")]
|
||||
#[cfg(feature = "sqlite")]
|
||||
#[test]
|
||||
fn parses_sqlite_get_column_name() {
|
||||
let actual = nu!(
|
||||
|
@ -1,6 +1,6 @@
|
||||
use nu_test_support::{nu, pipeline};
|
||||
|
||||
#[cfg(feature = "database")]
|
||||
#[cfg(feature = "sqlite")]
|
||||
#[test]
|
||||
fn can_query_single_table() {
|
||||
let actual = nu!(
|
||||
@ -16,7 +16,7 @@ fn can_query_single_table() {
|
||||
assert_eq!(actual.out, "4");
|
||||
}
|
||||
|
||||
#[cfg(feature = "database")]
|
||||
#[cfg(feature = "sqlite")]
|
||||
#[test]
|
||||
fn invalid_sql_fails() {
|
||||
let actual = nu!(
|
||||
@ -30,7 +30,7 @@ fn invalid_sql_fails() {
|
||||
assert!(actual.err.contains("syntax error"));
|
||||
}
|
||||
|
||||
#[cfg(feature = "database")]
|
||||
#[cfg(feature = "sqlite")]
|
||||
#[test]
|
||||
fn invalid_input_fails() {
|
||||
let actual = nu!(
|
||||
|
@ -1,5 +1,5 @@
|
||||
use nu_test_support::nu;
|
||||
#[cfg(feature = "database")]
|
||||
#[cfg(feature = "sqlite")]
|
||||
use nu_test_support::pipeline;
|
||||
|
||||
#[test]
|
||||
@ -82,7 +82,7 @@ fn uses_optional_index_argument() {
|
||||
assert_eq!(actual.out, "[7, 8]");
|
||||
}
|
||||
|
||||
#[cfg(feature = "database")]
|
||||
#[cfg(feature = "sqlite")]
|
||||
#[test]
|
||||
fn binary_operator_comparisons() {
|
||||
let actual = nu!(
|
||||
@ -151,7 +151,7 @@ fn binary_operator_comparisons() {
|
||||
assert_eq!(actual.out, "42");
|
||||
}
|
||||
|
||||
#[cfg(feature = "database")]
|
||||
#[cfg(feature = "sqlite")]
|
||||
#[test]
|
||||
fn contains_operator() {
|
||||
let actual = nu!(
|
||||
|
Reference in New Issue
Block a user