File tree Expand file tree Collapse file tree 13 files changed +71
-14
lines changed Expand file tree Collapse file tree 13 files changed +71
-14
lines changed Original file line number Diff line number Diff line change 3535 - uses : actions/checkout@master
3636 - run : cargo check --all-targets --all-features
3737
38+ compile-no-std :
39+ runs-on : ubuntu-latest
40+ steps :
41+ - name : Set up Rust
42+ uses : hecrj/setup-rust-action@v1
43+ with :
44+ targets : ' thumbv6m-none-eabi'
45+ - uses : actions/checkout@master
46+ - run : cargo check --no-default-features --target thumbv6m-none-eabi
47+
3848 test :
3949 strategy :
4050 matrix :
Original file line number Diff line number Diff line change @@ -13,12 +13,15 @@ include = [
1313 " Cargo.toml" ,
1414]
1515edition = " 2018"
16+ resolver = " 2"
1617
1718[lib ]
1819name = " sqlparser"
1920path = " src/lib.rs"
2021
2122[features ]
23+ default = [" std" ]
24+ std = []
2225# Enable JSON output in the `cli` example:
2326json_example = [" serde_json" , " serde" ]
2427
Original file line number Diff line number Diff line change 1010// See the License for the specific language governing permissions and
1111// limitations under the License.
1212
13- use std:: fmt;
13+ #[ cfg( not( feature = "std" ) ) ]
14+ use alloc:: boxed:: Box ;
15+ use core:: fmt;
1416
1517#[ cfg( feature = "serde" ) ]
1618use serde:: { Deserialize , Serialize } ;
Original file line number Diff line number Diff line change 1313//! AST types specific to CREATE/ALTER variants of [Statement]
1414//! (commonly referred to as Data Definition Language, or DDL)
1515
16- use std:: fmt;
16+ #[ cfg( not( feature = "std" ) ) ]
17+ use alloc:: { boxed:: Box , string:: ToString , vec:: Vec } ;
18+ use core:: fmt;
1719
1820#[ cfg( feature = "serde" ) ]
1921use serde:: { Deserialize , Serialize } ;
Original file line number Diff line number Diff line change @@ -18,7 +18,13 @@ mod operator;
1818mod query;
1919mod value;
2020
21- use std:: fmt;
21+ #[ cfg( not( feature = "std" ) ) ]
22+ use alloc:: {
23+ boxed:: Box ,
24+ string:: { String , ToString } ,
25+ vec:: Vec ,
26+ } ;
27+ use core:: fmt;
2228
2329#[ cfg( feature = "serde" ) ]
2430use serde:: { Deserialize , Serialize } ;
Original file line number Diff line number Diff line change 1010// See the License for the specific language governing permissions and
1111// limitations under the License.
1212
13- use std :: fmt;
13+ use core :: fmt;
1414
1515#[ cfg( feature = "serde" ) ]
1616use serde:: { Deserialize , Serialize } ;
Original file line number Diff line number Diff line change 1010// See the License for the specific language governing permissions and
1111// limitations under the License.
1212
13+ #[ cfg( not( feature = "std" ) ) ]
14+ use alloc:: { boxed:: Box , vec:: Vec } ;
15+
1316#[ cfg( feature = "serde" ) ]
1417use serde:: { Deserialize , Serialize } ;
1518
Original file line number Diff line number Diff line change 1010// See the License for the specific language governing permissions and
1111// limitations under the License.
1212
13- use std:: fmt;
13+ #[ cfg( not( feature = "std" ) ) ]
14+ use alloc:: string:: String ;
15+ use core:: fmt;
1416
1517#[ cfg( feature = "bigdecimal" ) ]
1618use bigdecimal:: BigDecimal ;
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ mod postgresql;
2020mod snowflake;
2121mod sqlite;
2222
23- use std :: any:: { Any , TypeId } ;
24- use std :: fmt:: Debug ;
23+ use core :: any:: { Any , TypeId } ;
24+ use core :: fmt:: Debug ;
2525
2626pub use self :: ansi:: AnsiDialect ;
2727pub use self :: generic:: GenericDialect ;
Original file line number Diff line number Diff line change 3232//!
3333//! println!("AST: {:?}", ast);
3434//! ```
35+
36+ #![ cfg_attr( not( feature = "std" ) , no_std) ]
3537#![ allow( clippy:: upper_case_acronyms) ]
3638
39+ #[ cfg( not( feature = "std" ) ) ]
40+ extern crate alloc;
41+
3742pub mod ast;
3843#[ macro_use]
3944pub mod dialect;
You can’t perform that action at this time.
0 commit comments